projects/linux·commit 110bc767

Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net

110bc767 · Linus Torvalds <[email protected]> · 2015-05-12 21:10:38 -07:00

Pull networking fixes from David Miller:

 1) Handle max TX power properly wrt VIFs and the MAC in iwlwifi, from
    Avri Altman.

 2) Use the correct FW API for scan completions in iwlwifi, from Avraham
    Stern.

 3) FW monitor in iwlwifi accidently uses unmapped memory, fix from Liad
    Kaufman.

 4) rhashtable conversion of mac80211 station table was buggy, the
    virtual interface was not taken into account.  Fix from Johannes
    Berg.

 5) Fix deadlock in rtlwifi by not using a zero timeout for
    usb_control_msg(), from Larry Finger.

 6) Update reordering state before calculating loss detection, from
    Yuchung Cheng.

 7) Fix off by one in bluetooth firmward parsing, from Dan Carpenter.

 8) Fix extended frame handling in xiling_can driver, from Jeppe
    Ledet-Pedersen.

 9) Fix CODEL packet scheduler behavior in the presence of TSO packets,
    from Eric Dumazet.

10) Fix NAPI budget testing in fm10k driver, from Alexander Duyck.

11) macvlan needs to propagate promisc settings down the the lower
    device, from Vlad Yasevich.

12) igb driver can oops when changing number of rings, from Toshiaki
    Makita.

13) Source specific default routes not handled properly in ipv6, from
    Markus Stenberg.

14) Use after free in tc_ctl_tfilter(), from WANG Cong.

15) Use softirq spinlocking in netxen driver, from Tony Camuso.

16) Two ARM bpf JIT fixes from Nicolas Schichan.

17) Handle MSG_DONTWAIT properly in ring based AF_PACKET sends, from
    Mathias Kretschmer.

18) Fix x86 bpf JIT implementation of FROM_{BE16,LE16,LE32}, from Alexei
    Starovoitov.

19) ll_temac driver DMA maps TX packet header with incorrect length, fix
    from Michal Simek.

20) We removed pm_qos bits from netdevice.h, but some indirect
    references remained.  Kill them.  From David Ahern.

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (90 commits)
  net: Remove remaining remnants of pm_qos from netdevice.h
  e1000e: Add pm_qos header
  net: phy: micrel: Fix regression in kszphy_probe
  net: ll_temac: Fix DMA map size bug
  x86: bpf_jit: fix FROM_BE16 and FROM_LE16/32 instructions
  netns: return RTM_NEWNSID instead of RTM_GETNSID on a get
  Update be2net maintainers' email addresses
  net_sched: gred: use correct backlog value in WRED mode
  pppoe: drop pppoe device in pppoe_unbind_sock_work
  net: qca_spi: Fix possible race during probe
  net: mdio-gpio: Allow for unspecified bus id
  af_packet / TX_RING not fully non-blocking (w/ MSG_DONTWAIT).
  bnx2x: limit fw delay in kdump to 5s after boot
  ARM: net: delegate filter to kernel interpreter when imm_offset() return value can't fit into 12bits.
  ARM: net fix emit_udiv() for BPF_ALU | BPF_DIV | BPF_K intruction.
  mpls: Change reserved label names to be consistent with netbsd
  usbnet: avoid integer overflow in start_xmit
  netxen_nic: use spin_[un]lock_bh around tx_clean_lock (2)
  net: xgene_enet: Set hardware dependency
  net: amd-xgbe: Add hardware dependency
  ...
Commit
110bc76729d448fdbcb5cdb63b83d9fd65ce5e26
Parents
6c9d370c · 01d460dd

Merge commit. Changes below are compared with the first parent: 6c9d370c.

Changes

102 files changed · +1838 −645

FileStatusAddDelContent
MAINTAINERSmodified+7−7View file
arch/arm/net/bpf_jit_32.cmodified+39−3View file
arch/x86/net/bpf_jit_comp.cmodified+28−0View file
drivers/bluetooth/bt3c_cs.cmodified+0−3View file
drivers/bluetooth/btbcm.cmodified+79−69View file
drivers/bluetooth/btbcm.hmodified+6−0View file
drivers/bluetooth/btusb.cmodified+401−2View file
drivers/bluetooth/hci_ath.cmodified+63−35View file
drivers/net/can/xilinx_can.cmodified+4−3View file
drivers/net/dsa/mv88e6xxx.cmodified+3−0View file
drivers/net/ethernet/amd/Kconfigmodified+1−0View file
drivers/net/ethernet/apm/xgene/Kconfigmodified+1−0View file
drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.cmodified+5−5View file
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.cmodified+7−2View file
drivers/net/ethernet/cadence/macb.cmodified+10−1View file
drivers/net/ethernet/intel/e1000e/e1000.hmodified+1−0View file
drivers/net/ethernet/intel/fm10k/fm10k_main.cmodified+2−2View file
drivers/net/ethernet/intel/igb/igb_main.cmodified+3−1View file
drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.cmodified+1−1View file
drivers/net/ethernet/mellanox/mlx4/en_port.cmodified+1−1View file
drivers/net/ethernet/mellanox/mlx4/resource_tracker.cmodified+7−7View file
drivers/net/ethernet/qlogic/netxen/netxen_nic_init.cmodified+2−2View file
drivers/net/ethernet/qualcomm/qca_spi.cmodified+2−2View file
drivers/net/ethernet/realtek/r8169.cmodified+2−2View file
drivers/net/ethernet/smsc/smc91x.cmodified+12−8View file
drivers/net/ethernet/smsc/smsc911x.cmodified+6−6View file
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.cmodified+1−0View file
drivers/net/ethernet/xilinx/ll_temac_main.cmodified+2−2View file
drivers/net/hyperv/netvsc.cmodified+2−7View file
drivers/net/ieee802154/at86rf230.cmodified+206−184View file
drivers/net/macvlan.cmodified+15−0View file
drivers/net/phy/Kconfigmodified+1−0View file
drivers/net/phy/mdio-gpio.cmodified+4−1View file
drivers/net/phy/micrel.cmodified+2−1View file
drivers/net/ppp/pppoe.cmodified+4−0View file
drivers/net/usb/r8152.cmodified+1−0View file
drivers/net/usb/usbnet.cmodified+2−2View file
drivers/net/wireless/ath/ath9k/xmit.cmodified+25−27View file
drivers/net/wireless/iwlwifi/iwl-fw-file.hmodified+2−0View file
drivers/net/wireless/iwlwifi/iwl-trans.hmodified+27−14View file
drivers/net/wireless/iwlwifi/mvm/d3.cmodified+1−1View file
drivers/net/wireless/iwlwifi/mvm/fw-api-power.hmodified+34−0View file
drivers/net/wireless/iwlwifi/mvm/fw-api-scan.hmodified+2−42View file
drivers/net/wireless/iwlwifi/mvm/fw-api.hmodified+0−13View file
drivers/net/wireless/iwlwifi/mvm/fw.cmodified+21−33View file
drivers/net/wireless/iwlwifi/mvm/mac80211.cmodified+23−3View file
drivers/net/wireless/iwlwifi/mvm/mvm.hmodified+0−1View file
drivers/net/wireless/iwlwifi/mvm/ops.cmodified+10−0View file
drivers/net/wireless/iwlwifi/mvm/rx.cmodified+5−0View file
drivers/net/wireless/iwlwifi/mvm/scan.cmodified+1−1View file
drivers/net/wireless/iwlwifi/pcie/trans.cmodified+9−8View file
drivers/net/wireless/rtlwifi/usb.cmodified+1−1View file
include/linux/netdevice.hmodified+0−3View file
include/linux/tcp.hmodified+8−0View file
include/net/cfg802154.hmodified+2−0View file
include/net/codel.hmodified+7−3View file
include/net/mac80211.hmodified+2−0View file
include/net/mac802154.hmodified+92−2View file
include/net/tcp.hmodified+5−2View file
include/uapi/linux/inet_diag.hmodified+4−0View file
include/uapi/linux/mpls.hmodified+10−0View file
include/uapi/linux/tcp.hmodified+3−0View file
net/bluetooth/hci_core.cmodified+2−1View file
net/core/dev.cmodified+1−1View file
net/core/net_namespace.cmodified+1−1View file
net/core/sock.cmodified+1−1View file
net/ieee802154/Makefilemodified+3−1View file
net/ieee802154/nl-phy.cmodified+4−1View file
net/ieee802154/nl802154.cmodified+1−1View file
net/ieee802154/rdev-ops.hmodified+72−13View file
net/ieee802154/trace.cadded+7−0View file
net/ieee802154/trace.hadded+247−0View file
net/ipv4/inet_diag.cmodified+5−3View file
net/ipv4/tcp.cmodified+27−1View file
net/ipv4/tcp_dctcp.cmodified+10−10View file
net/ipv4/tcp_fastopen.cmodified+1−0View file
net/ipv4/tcp_illinois.cmodified+11−10View file
net/ipv4/tcp_input.cmodified+26−10View file
net/ipv4/tcp_vegas.cmodified+10−9View file
net/ipv4/tcp_vegas.hmodified+2−1View file
net/ipv4/tcp_westwood.cmodified+8−7View file
net/ipv6/ip6_output.cmodified+31−8View file
net/ipv6/route.cmodified+3−2View file
net/mac80211/iface.cmodified+7−5View file
net/mac80211/sta_info.cmodified+18−1View file
net/mac802154/cfg.cmodified+6−3View file
net/mac802154/ieee802154_i.hmodified+2−1View file
net/mac802154/iface.cmodified+3−2View file
net/mac802154/llsec.cmodified+2−2View file
net/mac802154/main.cmodified+5−2View file
net/mpls/af_mpls.cmodified+9−9View file
net/mpls/internal.hmodified+0−10View file
net/netlink/af_netlink.cmodified+0−1View file
net/packet/af_packet.cmodified+6−3View file
net/rds/connection.cmodified+15−2View file
net/rds/ib_cm.cmodified+11−2View file
net/rds/tcp_connect.cmodified+1−0View file
net/rds/tcp_listen.cmodified+46−0View file
net/sched/cls_api.cmodified+3−4View file
net/sched/sch_codel.cmodified+1−1View file
net/sched/sch_fq_codel.cmodified+1−1View file
net/sched/sch_gred.cmodified+2−2View file

Only the first 600 diff lines are shown. Download the complete patch.

MAINTAINERS

View file
diff --git a/MAINTAINERS b/MAINTAINERS
index 06c0fd5..5d87ccb 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -4377,11 +4377,10 @@ F: fs/gfs2/
F: include/uapi/linux/gfs2_ondisk.h
GIGASET ISDN DRIVERS
-M: Hansjoerg Lipp <[email protected]>
-M: Tilman Schmidt <[email protected]>
+M: Paul Bolle <[email protected]>
W: http://gigaset307x.sourceforge.net/
-S: Maintained
+S: Odd Fixes
F: Documentation/isdn/README.gigaset
F: drivers/isdn/gigaset/
F: include/uapi/linux/gigaset_dev.h
@@ -8827,10 +8826,11 @@ W: http://www.emulex.com
S: Supported
F: drivers/scsi/be2iscsi/
-SERVER ENGINES 10Gbps NIC - BladeEngine 2 DRIVER
-M: Sathya Perla <[email protected]>
-M: Subbu Seetharaman <[email protected]>
-M: Ajit Khaparde <[email protected]>
+Emulex 10Gbps NIC BE2, BE3-R, Lancer, Skyhawk-R DRIVER
+M: Sathya Perla <[email protected]>
+M: Ajit Khaparde <[email protected]>
+M: Padmanabh Ratnakar <[email protected]>
+M: Sriharsha Basavapatna <[email protected]>
W: http://www.emulex.com
S: Supported

arch/arm/net/bpf_jit_32.c

View file
diff --git a/arch/arm/net/bpf_jit_32.c b/arch/arm/net/bpf_jit_32.c
index e1268f9..e0e2358 100644
--- a/arch/arm/net/bpf_jit_32.c
+++ b/arch/arm/net/bpf_jit_32.c
@@ -54,6 +54,7 @@
#define SEEN_DATA (1 << (BPF_MEMWORDS + 3))
#define FLAG_NEED_X_RESET (1 << 0)
+#define FLAG_IMM_OVERFLOW (1 << 1)
struct jit_ctx {
const struct bpf_prog *skf;
@@ -293,6 +294,15 @@ static u16 imm_offset(u32 k, struct jit_ctx *ctx)
/* PC in ARM mode == address of the instruction + 8 */
imm = offset - (8 + ctx->idx * 4);
+ if (imm & ~0xfff) {
+ /*
+ * literal pool is too far, signal it into flags. we
+ * can only detect it on the second pass unfortunately.
+ */
+ ctx->flags |= FLAG_IMM_OVERFLOW;
+ return 0;
+ }
+
return imm;
}
@@ -449,10 +459,21 @@ static inline void emit_udiv(u8 rd, u8 rm, u8 rn, struct jit_ctx *ctx)
return;
}
#endif
- if (rm != ARM_R0)
- emit(ARM_MOV_R(ARM_R0, rm), ctx);
+
+ /*
+ * For BPF_ALU | BPF_DIV | BPF_K instructions, rm is ARM_R4
+ * (r_A) and rn is ARM_R0 (r_scratch) so load rn first into
+ * ARM_R1 to avoid accidentally overwriting ARM_R0 with rm
+ * before using it as a source for ARM_R1.
+ *
+ * For BPF_ALU | BPF_DIV | BPF_X rm is ARM_R4 (r_A) and rn is
+ * ARM_R5 (r_X) so there is no particular register overlap
+ * issues.
+ */
if (rn != ARM_R1)
emit(ARM_MOV_R(ARM_R1, rn), ctx);
+ if (rm != ARM_R0)
+ emit(ARM_MOV_R(ARM_R0, rm), ctx);
ctx->seen |= SEEN_CALL;
emit_mov_i(ARM_R3, (u32)jit_udiv, ctx);
@@ -855,6 +876,14 @@ b_epilogue:
default:
return -1;
}
+
+ if (ctx->flags & FLAG_IMM_OVERFLOW)
+ /*
+ * this instruction generated an overflow when
+ * trying to access the literal pool, so
+ * delegate this filter to the kernel interpreter.
+ */
+ return -1;
}
/* compute offsets only during the first pass */
@@ -917,7 +946,14 @@ void bpf_jit_compile(struct bpf_prog *fp)
ctx.idx = 0;
build_prologue(&ctx);
- build_body(&ctx);
+ if (build_body(&ctx) < 0) {
+#if __LINUX_ARM_ARCH__ < 7
+ if (ctx.imm_count)
+ kfree(ctx.imms);
+#endif
+ bpf_jit_binary_free(header);
+ goto out;
+ }
build_epilogue(&ctx);
flush_icache_range((u32)ctx.target, (u32)(ctx.target + ctx.idx));

arch/x86/net/bpf_jit_comp.c

View file
diff --git a/arch/x86/net/bpf_jit_comp.c b/arch/x86/net/bpf_jit_comp.c
index 9875143..99f7610 100644
--- a/arch/x86/net/bpf_jit_comp.c
+++ b/arch/x86/net/bpf_jit_comp.c
@@ -559,6 +559,13 @@ static int do_jit(struct bpf_prog *bpf_prog, int *addrs, u8 *image,
if (is_ereg(dst_reg))
EMIT1(0x41);
EMIT3(0xC1, add_1reg(0xC8, dst_reg), 8);
+
+ /* emit 'movzwl eax, ax' */
+ if (is_ereg(dst_reg))
+ EMIT3(0x45, 0x0F, 0xB7);
+ else
+ EMIT2(0x0F, 0xB7);
+ EMIT1(add_2reg(0xC0, dst_reg, dst_reg));
break;
case 32:
/* emit 'bswap eax' to swap lower 4 bytes */
@@ -577,6 +584,27 @@ static int do_jit(struct bpf_prog *bpf_prog, int *addrs, u8 *image,
break;
case BPF_ALU | BPF_END | BPF_FROM_LE:
+ switch (imm32) {
+ case 16:
+ /* emit 'movzwl eax, ax' to zero extend 16-bit
+ * into 64 bit
+ */
+ if (is_ereg(dst_reg))
+ EMIT3(0x45, 0x0F, 0xB7);
+ else
+ EMIT2(0x0F, 0xB7);
+ EMIT1(add_2reg(0xC0, dst_reg, dst_reg));
+ break;
+ case 32:
+ /* emit 'mov eax, eax' to clear upper 32-bits */
+ if (is_ereg(dst_reg))
+ EMIT1(0x45);
+ EMIT2(0x89, add_2reg(0xC0, dst_reg, dst_reg));
+ break;
+ case 64:
+ /* nop */
+ break;
+ }
break;
/* ST: *(u8*)(dst_reg + off) = imm */

drivers/bluetooth/bt3c_cs.c

View file
diff --git a/drivers/bluetooth/bt3c_cs.c b/drivers/bluetooth/bt3c_cs.c
index 4f7e8d4..6de97b3 100644
--- a/drivers/bluetooth/bt3c_cs.c
+++ b/drivers/bluetooth/bt3c_cs.c
@@ -227,7 +227,6 @@ static void bt3c_receive(struct bt3c_info *info)
iobase = info->p_dev->resource[0]->start;
avail = bt3c_read(iobase, 0x7006);
- //printk("bt3c_cs: receiving %d bytes\n", avail);
bt3c_address(iobase, 0x7480);
while (size < avail) {
@@ -250,7 +249,6 @@ static void bt3c_receive(struct bt3c_info *info)
bt_cb(info->rx_skb)->pkt_type = inb(iobase + DATA_L);
inb(iobase + DATA_H);
- //printk("bt3c: PACKET_TYPE=%02x\n", bt_cb(info->rx_skb)->pkt_type);
switch (bt_cb(info->rx_skb)->pkt_type) {
@@ -364,7 +362,6 @@ static irqreturn_t bt3c_interrupt(int irq, void *dev_inst)
if (stat & 0x0001)
bt3c_receive(info);
if (stat & 0x0002) {
- //BT_ERR("Ack (stat=0x%04x)", stat);
clear_bit(XMIT_SENDING, &(info->tx_state));
bt3c_write_wakeup(info);
}

drivers/bluetooth/btbcm.c

View file
diff --git a/drivers/bluetooth/btbcm.c b/drivers/bluetooth/btbcm.c
index d0741f3..4bba866 100644
--- a/drivers/bluetooth/btbcm.c
+++ b/drivers/bluetooth/btbcm.c
@@ -95,6 +95,78 @@ int btbcm_set_bdaddr(struct hci_dev *hdev, const bdaddr_t *bdaddr)
}
EXPORT_SYMBOL_GPL(btbcm_set_bdaddr);
+int btbcm_patchram(struct hci_dev *hdev, const char *firmware)
+{
+ const struct hci_command_hdr *cmd;
+ const struct firmware *fw;
+ const u8 *fw_ptr;
+ size_t fw_size;
+ struct sk_buff *skb;
+ u16 opcode;
+ int err;
+
+ err = request_firmware(&fw, firmware, &hdev->dev);
+ if (err < 0) {
+ BT_INFO("%s: BCM: Patch %s not found", hdev->name, firmware);
+ return err;
+ }
+
+ /* Start Download */
+ skb = __hci_cmd_sync(hdev, 0xfc2e, 0, NULL, HCI_INIT_TIMEOUT);
+ if (IS_ERR(skb)) {
+ err = PTR_ERR(skb);
+ BT_ERR("%s: BCM: Download Minidrv command failed (%d)",
+ hdev->name, err);
+ goto done;
+ }
+ kfree_skb(skb);
+
+ /* 50 msec delay after Download Minidrv completes */
+ msleep(50);
+
+ fw_ptr = fw->data;
+ fw_size = fw->size;
+
+ while (fw_size >= sizeof(*cmd)) {
+ const u8 *cmd_param;
+
+ cmd = (struct hci_command_hdr *)fw_ptr;
+ fw_ptr += sizeof(*cmd);
+ fw_size -= sizeof(*cmd);
+
+ if (fw_size < cmd->plen) {
+ BT_ERR("%s: BCM: Patch %s is corrupted", hdev->name,
+ firmware);
+ err = -EINVAL;
+ goto done;
+ }
+
+ cmd_param = fw_ptr;
+ fw_ptr += cmd->plen;
+ fw_size -= cmd->plen;
+
+ opcode = le16_to_cpu(cmd->opcode);
+
+ skb = __hci_cmd_sync(hdev, opcode, cmd->plen, cmd_param,
+ HCI_INIT_TIMEOUT);
+ if (IS_ERR(skb)) {
+ err = PTR_ERR(skb);
+ BT_ERR("%s: BCM: Patch command %04x failed (%d)",
+ hdev->name, opcode, err);
+ goto done;
+ }
+ kfree_skb(skb);
+ }
+
+ /* 250 msec delay after Launch Ram completes */
+ msleep(250);
+
+done:
+ release_firmware(fw);
+ return err;
+}
+EXPORT_SYMBOL(btbcm_patchram);
+
static int btbcm_reset(struct hci_dev *hdev)
{
struct sk_buff *skb;
@@ -198,12 +270,8 @@ static const struct {
int btbcm_setup_patchram(struct hci_dev *hdev)
{
- const struct hci_command_hdr *cmd;
- const struct firmware *fw;
- const u8 *fw_ptr;
- size_t fw_size;
char fw_name[64];
- u16 opcode, subver, rev, pid, vid;
+ u16 subver, rev, pid, vid;
const char *hw_name = NULL;
struct sk_buff *skb;
struct hci_rp_read_local_version *ver;
@@ -273,74 +341,19 @@ int btbcm_setup_patchram(struct hci_dev *hdev)
hw_name ? : "BCM", (subver & 0x7000) >> 13,
(subver & 0x1f00) >> 8, (subver & 0x00ff), rev & 0x0fff);
- err = request_firmware(&fw, fw_name, &hdev->dev);
- if (err < 0) {
- BT_INFO("%s: BCM: patch %s not found", hdev->name, fw_name);
+ err = btbcm_patchram(hdev, fw_name);
+ if (err == -ENOENT)
return 0;
- }
-
- /* Start Download */
- skb = __hci_cmd_sync(hdev, 0xfc2e, 0, NULL, HCI_INIT_TIMEOUT);
- if (IS_ERR(skb)) {
- err = PTR_ERR(skb);
- BT_ERR("%s: BCM: Download Minidrv command failed (%d)",
- hdev->name, err);
- goto reset;
- }
- kfree_skb(skb);
-
- /* 50 msec delay after Download Minidrv completes */
- msleep(50);
-
- fw_ptr = fw->data;
- fw_size = fw->size;
-
- while (fw_size >= sizeof(*cmd)) {
- const u8 *cmd_param;
-
- cmd = (struct hci_command_hdr *)fw_ptr;
- fw_ptr += sizeof(*cmd);
- fw_size -= sizeof(*cmd);
-
- if (fw_size < cmd->plen) {
- BT_ERR("%s: BCM: patch %s is corrupted", hdev->name,
- fw_name);
- err = -EINVAL;
- goto reset;
- }
- cmd_param = fw_ptr;
- fw_ptr += cmd->plen;
- fw_size -= cmd->plen;
-
- opcode = le16_to_cpu(cmd->opcode);
-
- skb = __hci_cmd_sync(hdev, opcode, cmd->plen, cmd_param,
- HCI_INIT_TIMEOUT);
- if (IS_ERR(skb)) {
- err = PTR_ERR(skb);
- BT_ERR("%s: BCM: patch command %04x failed (%d)",
- hdev->name, opcode, err);
- goto reset;
- }
- kfree_skb(skb);
- }
-
- /* 250 msec delay after Launch Ram completes */
- msleep(250);
-
-reset:
/* Reset */
err = btbcm_reset(hdev);
if (err)
- goto done;
+ return err;
/* Read Local Version Info */
skb = btbcm_read_local_version(hdev);
- if (IS_ERR(skb)) {
- err = PTR_ERR(skb);
- goto done;
- }
+ if (IS_ERR(skb))
+ return PTR_ERR(skb);
ver = (struct hci_rp_read_local_version *)skb->data;
rev = le16_to_cpu(ver->hci_rev);
@@ -355,10 +368,7 @@ reset:
set_bit(HCI_QUIRK_STRICT_DUPLICATE_FILTER, &hdev->quirks);
-done:
- release_firmware(fw);
-
- return err;
+ return 0;
}
EXPORT_SYMBOL_GPL(btbcm_setup_patchram);

drivers/bluetooth/btbcm.h

View file
diff --git a/drivers/bluetooth/btbcm.h b/drivers/bluetooth/btbcm.h
index 34268ae..eb6ab5f 100644
--- a/drivers/bluetooth/btbcm.h
+++ b/drivers/bluetooth/btbcm.h
@@ -25,6 +25,7 @@
int btbcm_check_bdaddr(struct hci_dev *hdev);
int btbcm_set_bdaddr(struct hci_dev *hdev, const bdaddr_t *bdaddr);
+int btbcm_patchram(struct hci_dev *hdev, const char *firmware);
int btbcm_setup_patchram(struct hci_dev *hdev);
int btbcm_setup_apple(struct hci_dev *hdev);
@@ -41,6 +42,11 @@ static inline int btbcm_set_bdaddr(struct hci_dev *hdev, const bdaddr_t *bdaddr)
return -EOPNOTSUPP;
}
+static inline int btbcm_patchram(struct hci_dev *hdev, const char *firmware)
+{
+ return -EOPNOTSUPP;
+}
+
static inline int btbcm_setup_patchram(struct hci_dev *hdev)
{
return 0;

drivers/bluetooth/btusb.c

View file
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index de7b236..d21f3b4 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -24,6 +24,7 @@
#include <linux/module.h>
#include <linux/usb.h>
#include <linux/firmware.h>
+#include <asm/unaligned.h>
#include <net/bluetooth/bluetooth.h>
#include <net/bluetooth/hci_core.h>
@@ -57,6 +58,7 @@ static struct usb_driver btusb_driver;
#define BTUSB_AMP 0x4000
#define BTUSB_QCA_ROME 0x8000
#define BTUSB_BCM_APPLE 0x10000
+#define BTUSB_REALTEK 0x20000
static const struct usb_device_id btusb_table[] = {
/* Generic Bluetooth USB device */
@@ -288,6 +290,28 @@ static const struct usb_device_id blacklist_table[] = {
{ USB_VENDOR_AND_INTERFACE_INFO(0x8087, 0xe0, 0x01, 0x01),
.driver_info = BTUSB_IGNORE },
+ /* Realtek Bluetooth devices */
+ { USB_VENDOR_AND_INTERFACE_INFO(0x0bda, 0xe0, 0x01, 0x01),
+ .driver_info = BTUSB_REALTEK },
+
+ /* Additional Realtek 8723AE Bluetooth devices */
+ { USB_DEVICE(0x0930, 0x021d), .driver_info = BTUSB_REALTEK },
+ { USB_DEVICE(0x13d3, 0x3394), .driver_info = BTUSB_REALTEK },
+
+ /* Additional Realtek 8723BE Bluetooth devices */
+ { USB_DEVICE(0x0489, 0xe085), .driver_info = BTUSB_REALTEK },
+ { USB_DEVICE(0x0489, 0xe08b), .driver_info = BTUSB_REALTEK },
+ { USB_DEVICE(0x13d3, 0x3410), .driver_info = BTUSB_REALTEK },
+ { USB_DEVICE(0x13d3, 0x3416), .driver_info = BTUSB_REALTEK },
+ { USB_DEVICE(0x13d3, 0x3459), .driver_info = BTUSB_REALTEK },
+
+ /* Additional Realtek 8821AE Bluetooth devices */
+ { USB_DEVICE(0x0b05, 0x17dc), .driver_info = BTUSB_REALTEK },
+ { USB_DEVICE(0x13d3, 0x3414), .driver_info = BTUSB_REALTEK },
+ { USB_DEVICE(0x13d3, 0x3458), .driver_info = BTUSB_REALTEK },
+ { USB_DEVICE(0x13d3, 0x3461), .driver_info = BTUSB_REALTEK },
+ { USB_DEVICE(0x13d3, 0x3462), .driver_info = BTUSB_REALTEK },
+
{ } /* Terminating entry */
};
@@ -892,7 +916,7 @@ static int btusb_open(struct hci_dev *hdev)
*/
if (data->setup_on_usb) {
err = data->setup_on_usb(hdev);
- if (err <0)
+ if (err < 0)
return err;
}
@@ -1345,6 +1369,378 @@ static int btusb_setup_csr(struct hci_dev *hdev)
return ret;
}
+#define RTL_FRAG_LEN 252
+
+struct rtl_download_cmd {
+ __u8 index;
+ __u8 data[RTL_FRAG_LEN];
+} __packed;
+
+struct rtl_download_response {
+ __u8 status;
+ __u8 index;
+} __packed;
+
+struct rtl_rom_version_evt {
+ __u8 status;
+ __u8 version;
+} __packed;
+
+struct rtl_epatch_header {
+ __u8 signature[8];
+ __le32 fw_version;
+ __le16 num_patches;
+} __packed;
+
+#define RTL_EPATCH_SIGNATURE "Realtech"
+#define RTL_ROM_LMP_3499 0x3499
+#define RTL_ROM_LMP_8723A 0x1200
+#define RTL_ROM_LMP_8723B 0x8723
+#define RTL_ROM_LMP_8821A 0x8821
+#define RTL_ROM_LMP_8761A 0x8761
+
+static int rtl_read_rom_version(struct hci_dev *hdev, u8 *version)
+{
+ struct rtl_rom_version_evt *rom_version;
+ struct sk_buff *skb;
+ int ret;
+
+ /* Read RTL ROM version command */
+ skb = __hci_cmd_sync(hdev, 0xfc6d, 0, NULL, HCI_INIT_TIMEOUT);
+ if (IS_ERR(skb)) {
+ BT_ERR("%s: Read ROM version failed (%ld)",
+ hdev->name, PTR_ERR(skb));
+ return PTR_ERR(skb);
+ }
+
+ if (skb->len != sizeof(*rom_version)) {
+ BT_ERR("%s: RTL version event length mismatch", hdev->name);
+ kfree_skb(skb);
+ return -EIO;
+ }
+
+ rom_version = (struct rtl_rom_version_evt *)skb->data;
+ BT_INFO("%s: rom_version status=%x version=%x",
+ hdev->name, rom_version->status, rom_version->version);
+
+ ret = rom_version->status;
+ if (ret == 0)
+ *version = rom_version->version;
+
+ kfree_skb(skb);
+ return ret;
+}
+
+static int rtl8723b_parse_firmware(struct hci_dev *hdev, u16 lmp_subver,
+ const struct firmware *fw,
+ unsigned char **_buf)
+{
+ const u8 extension_sig[] = { 0x51, 0x04, 0xfd, 0x77 };
+ struct rtl_epatch_header *epatch_info;
+ unsigned char *buf;
+ int i, ret, len;
+ size_t min_size;
+ u8 opcode, length, data, rom_version = 0;
+ int project_id = -1;
+ const unsigned char *fwptr, *chip_id_base;
+ const unsigned char *patch_length_base, *patch_offset_base;
+ u32 patch_offset = 0;
+ u16 patch_length, num_patches;
+ const u16 project_id_to_lmp_subver[] = {
+ RTL_ROM_LMP_8723A,
+ RTL_ROM_LMP_8723B,
+ RTL_ROM_LMP_8821A,
+ RTL_ROM_LMP_8761A
+ };
+
+ ret = rtl_read_rom_version(hdev, &rom_version);
+ if (ret)
+ return -bt_to_errno(ret);
+
+ min_size = sizeof(struct rtl_epatch_header) + sizeof(extension_sig) + 3;
+ if (fw->size < min_size)
+ return -EINVAL;
+
+ fwptr = fw->data + fw->size - sizeof(extension_sig);
+ if (memcmp(fwptr, extension_sig, sizeof(extension_sig)) != 0) {
+ BT_ERR("%s: extension section signature mismatch", hdev->name);
+ return -EINVAL;
+ }
+
+ /* Loop from the end of the firmware parsing instructions, until
+ * we find an instruction that identifies the "project ID" for the
+ * hardware supported by this firwmare file.
+ * Once we have that, we double-check that that project_id is suitable
+ * for the hardware we are working with.
+ */
+ while (fwptr >= fw->data + (sizeof(struct rtl_epatch_header) + 3)) {
+ opcode = *--fwptr;
+ length = *--fwptr;
+ data = *--fwptr;
+
+ BT_DBG("check op=%x len=%x data=%x", opcode, length, data);
+
+ if (opcode == 0xff) /* EOF */
+ break;
+
+ if (length == 0) {
+ BT_ERR("%s: found instruction with length 0",
+ hdev->name);
+ return -EINVAL;
+ }
+
+ if (opcode == 0 && length == 1) {
+ project_id = data;
+ break;
+ }
+
+ fwptr -= length;
+ }
+
+ if (project_id < 0) {
+ BT_ERR("%s: failed to find version instruction", hdev->name);
+ return -EINVAL;
+ }
+
+ if (project_id >= ARRAY_SIZE(project_id_to_lmp_subver)) {

This diff is incomplete. Download the complete patch.

drivers/bluetooth/hci_ath.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/can/xilinx_can.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/dsa/mv88e6xxx.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/amd/Kconfig

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/apm/xgene/Kconfig

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/cadence/macb.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/intel/e1000e/e1000.h

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/intel/fm10k/fm10k_main.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/intel/igb/igb_main.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/mellanox/mlx4/en_port.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/mellanox/mlx4/resource_tracker.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/qlogic/netxen/netxen_nic_init.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/qualcomm/qca_spi.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/realtek/r8169.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/smsc/smc91x.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/smsc/smsc911x.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/ethernet/xilinx/ll_temac_main.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/hyperv/netvsc.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/ieee802154/at86rf230.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/macvlan.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/phy/Kconfig

View file

This diff is incomplete. Download the complete patch.

drivers/net/phy/mdio-gpio.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/phy/micrel.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/ppp/pppoe.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/usb/r8152.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/usb/usbnet.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/wireless/ath/ath9k/xmit.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/wireless/iwlwifi/iwl-fw-file.h

View file

This diff is incomplete. Download the complete patch.

drivers/net/wireless/iwlwifi/iwl-trans.h

View file

This diff is incomplete. Download the complete patch.

drivers/net/wireless/iwlwifi/mvm/d3.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/wireless/iwlwifi/mvm/fw-api-power.h

View file

This diff is incomplete. Download the complete patch.

drivers/net/wireless/iwlwifi/mvm/fw-api-scan.h

View file

This diff is incomplete. Download the complete patch.

drivers/net/wireless/iwlwifi/mvm/fw-api.h

View file

This diff is incomplete. Download the complete patch.

drivers/net/wireless/iwlwifi/mvm/fw.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/wireless/iwlwifi/mvm/mac80211.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/wireless/iwlwifi/mvm/mvm.h

View file

This diff is incomplete. Download the complete patch.

drivers/net/wireless/iwlwifi/mvm/ops.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/wireless/iwlwifi/mvm/rx.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/wireless/iwlwifi/mvm/scan.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/wireless/iwlwifi/pcie/trans.c

View file

This diff is incomplete. Download the complete patch.

drivers/net/wireless/rtlwifi/usb.c

View file

This diff is incomplete. Download the complete patch.

include/linux/netdevice.h

View file

This diff is incomplete. Download the complete patch.

include/linux/tcp.h

View file

This diff is incomplete. Download the complete patch.

include/net/cfg802154.h

View file

This diff is incomplete. Download the complete patch.

include/net/codel.h

View file

This diff is incomplete. Download the complete patch.

include/net/mac80211.h

View file

This diff is incomplete. Download the complete patch.

include/net/mac802154.h

View file

This diff is incomplete. Download the complete patch.

include/net/tcp.h

View file

This diff is incomplete. Download the complete patch.

include/uapi/linux/inet_diag.h

View file

This diff is incomplete. Download the complete patch.

include/uapi/linux/mpls.h

View file

This diff is incomplete. Download the complete patch.

include/uapi/linux/tcp.h

View file

This diff is incomplete. Download the complete patch.

net/bluetooth/hci_core.c

View file

This diff is incomplete. Download the complete patch.

net/core/dev.c

View file

This diff is incomplete. Download the complete patch.

net/core/net_namespace.c

View file

This diff is incomplete. Download the complete patch.

net/core/sock.c

View file

This diff is incomplete. Download the complete patch.

net/ieee802154/Makefile

View file

This diff is incomplete. Download the complete patch.

net/ieee802154/nl-phy.c

View file

This diff is incomplete. Download the complete patch.

net/ieee802154/nl802154.c

View file

This diff is incomplete. Download the complete patch.

net/ieee802154/rdev-ops.h

View file

This diff is incomplete. Download the complete patch.

net/ieee802154/trace.c

View file

This diff is incomplete. Download the complete patch.

net/ieee802154/trace.h

View file

This diff is incomplete. Download the complete patch.

net/ipv4/inet_diag.c

View file

This diff is incomplete. Download the complete patch.

net/ipv4/tcp.c

View file

This diff is incomplete. Download the complete patch.

net/ipv4/tcp_dctcp.c

View file

This diff is incomplete. Download the complete patch.

net/ipv4/tcp_fastopen.c

View file

This diff is incomplete. Download the complete patch.

net/ipv4/tcp_illinois.c

View file

This diff is incomplete. Download the complete patch.

net/ipv4/tcp_input.c

View file

This diff is incomplete. Download the complete patch.

net/ipv4/tcp_vegas.c

View file

This diff is incomplete. Download the complete patch.

net/ipv4/tcp_vegas.h

View file

This diff is incomplete. Download the complete patch.

net/ipv4/tcp_westwood.c

View file

This diff is incomplete. Download the complete patch.

net/ipv6/ip6_output.c

View file

This diff is incomplete. Download the complete patch.

net/ipv6/route.c

View file

This diff is incomplete. Download the complete patch.

net/mac80211/iface.c

View file

This diff is incomplete. Download the complete patch.

net/mac80211/sta_info.c

View file

This diff is incomplete. Download the complete patch.

net/mac802154/cfg.c

View file

This diff is incomplete. Download the complete patch.

net/mac802154/ieee802154_i.h

View file

This diff is incomplete. Download the complete patch.

net/mac802154/iface.c

View file

This diff is incomplete. Download the complete patch.

net/mac802154/llsec.c

View file

This diff is incomplete. Download the complete patch.

net/mac802154/main.c

View file

This diff is incomplete. Download the complete patch.

net/mpls/af_mpls.c

View file

This diff is incomplete. Download the complete patch.

net/mpls/internal.h

View file

This diff is incomplete. Download the complete patch.

net/netlink/af_netlink.c

View file

This diff is incomplete. Download the complete patch.

net/packet/af_packet.c

View file

This diff is incomplete. Download the complete patch.

net/rds/connection.c

View file

This diff is incomplete. Download the complete patch.

net/rds/ib_cm.c

View file

This diff is incomplete. Download the complete patch.

net/rds/tcp_connect.c

View file

This diff is incomplete. Download the complete patch.

net/rds/tcp_listen.c

View file

This diff is incomplete. Download the complete patch.

net/sched/cls_api.c

View file

This diff is incomplete. Download the complete patch.

net/sched/sch_codel.c

View file

This diff is incomplete. Download the complete patch.

net/sched/sch_fq_codel.c

View file

This diff is incomplete. Download the complete patch.

net/sched/sch_gred.c

View file

This diff is incomplete. Download the complete patch.