mirror of
https://github.com/linux-msm/laptops-kernel.git
synced 2026-08-13 14:19:53 -07:00
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
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
...
This commit is contained in:
+7
-7
@@ -4377,11 +4377,10 @@ F: fs/gfs2/
|
||||
F: include/uapi/linux/gfs2_ondisk.h
|
||||
|
||||
GIGASET ISDN DRIVERS
|
||||
M: Hansjoerg Lipp <hjlipp@web.de>
|
||||
M: Tilman Schmidt <tilman@imap.cc>
|
||||
M: Paul Bolle <pebolle@tiscali.nl>
|
||||
L: gigaset307x-common@lists.sourceforge.net
|
||||
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 <sathya.perla@emulex.com>
|
||||
M: Subbu Seetharaman <subbu.seetharaman@emulex.com>
|
||||
M: Ajit Khaparde <ajit.khaparde@emulex.com>
|
||||
Emulex 10Gbps NIC BE2, BE3-R, Lancer, Skyhawk-R DRIVER
|
||||
M: Sathya Perla <sathya.perla@avagotech.com>
|
||||
M: Ajit Khaparde <ajit.khaparde@avagotech.com>
|
||||
M: Padmanabh Ratnakar <padmanabh.ratnakar@avagotech.com>
|
||||
M: Sriharsha Basavapatna <sriharsha.basavapatna@avagotech.com>
|
||||
L: netdev@vger.kernel.org
|
||||
W: http://www.emulex.com
|
||||
S: Supported
|
||||
|
||||
@@ -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));
|
||||
|
||||
@@ -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 */
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
+79
-69
@@ -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);
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
+401
-2
@@ -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)) {
|
||||
BT_ERR("%s: unknown project id %d", hdev->name, project_id);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (lmp_subver != project_id_to_lmp_subver[project_id]) {
|
||||
BT_ERR("%s: firmware is for %x but this is a %x", hdev->name,
|
||||
project_id_to_lmp_subver[project_id], lmp_subver);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
epatch_info = (struct rtl_epatch_header *)fw->data;
|
||||
if (memcmp(epatch_info->signature, RTL_EPATCH_SIGNATURE, 8) != 0) {
|
||||
BT_ERR("%s: bad EPATCH signature", hdev->name);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
num_patches = le16_to_cpu(epatch_info->num_patches);
|
||||
BT_DBG("fw_version=%x, num_patches=%d",
|
||||
le32_to_cpu(epatch_info->fw_version), num_patches);
|
||||
|
||||
/* After the rtl_epatch_header there is a funky patch metadata section.
|
||||
* Assuming 2 patches, the layout is:
|
||||
* ChipID1 ChipID2 PatchLength1 PatchLength2 PatchOffset1 PatchOffset2
|
||||
*
|
||||
* Find the right patch for this chip.
|
||||
*/
|
||||
min_size += 8 * num_patches;
|
||||
if (fw->size < min_size)
|
||||
return -EINVAL;
|
||||
|
||||
chip_id_base = fw->data + sizeof(struct rtl_epatch_header);
|
||||
patch_length_base = chip_id_base + (sizeof(u16) * num_patches);
|
||||
patch_offset_base = patch_length_base + (sizeof(u16) * num_patches);
|
||||
for (i = 0; i < num_patches; i++) {
|
||||
u16 chip_id = get_unaligned_le16(chip_id_base +
|
||||
(i * sizeof(u16)));
|
||||
if (chip_id == rom_version + 1) {
|
||||
patch_length = get_unaligned_le16(patch_length_base +
|
||||
(i * sizeof(u16)));
|
||||
patch_offset = get_unaligned_le32(patch_offset_base +
|
||||
(i * sizeof(u32)));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!patch_offset) {
|
||||
BT_ERR("%s: didn't find patch for chip id %d",
|
||||
hdev->name, rom_version);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
BT_DBG("length=%x offset=%x index %d", patch_length, patch_offset, i);
|
||||
min_size = patch_offset + patch_length;
|
||||
if (fw->size < min_size)
|
||||
return -EINVAL;
|
||||
|
||||
/* Copy the firmware into a new buffer and write the version at
|
||||
* the end.
|
||||
*/
|
||||
len = patch_length;
|
||||
buf = kmemdup(fw->data + patch_offset, patch_length, GFP_KERNEL);
|
||||
if (!buf)
|
||||
return -ENOMEM;
|
||||
|
||||
memcpy(buf + patch_length - 4, &epatch_info->fw_version, 4);
|
||||
|
||||
*_buf = buf;
|
||||
return len;
|
||||
}
|
||||
|
||||
static int rtl_download_firmware(struct hci_dev *hdev,
|
||||
const unsigned char *data, int fw_len)
|
||||
{
|
||||
struct rtl_download_cmd *dl_cmd;
|
||||
int frag_num = fw_len / RTL_FRAG_LEN + 1;
|
||||
int frag_len = RTL_FRAG_LEN;
|
||||
int ret = 0;
|
||||
int i;
|
||||
|
||||
dl_cmd = kmalloc(sizeof(struct rtl_download_cmd), GFP_KERNEL);
|
||||
if (!dl_cmd)
|
||||
return -ENOMEM;
|
||||
|
||||
for (i = 0; i < frag_num; i++) {
|
||||
struct rtl_download_response *dl_resp;
|
||||
struct sk_buff *skb;
|
||||
|
||||
BT_DBG("download fw (%d/%d)", i, frag_num);
|
||||
|
||||
dl_cmd->index = i;
|
||||
if (i == (frag_num - 1)) {
|
||||
dl_cmd->index |= 0x80; /* data end */
|
||||
frag_len = fw_len % RTL_FRAG_LEN;
|
||||
}
|
||||
memcpy(dl_cmd->data, data, frag_len);
|
||||
|
||||
/* Send download command */
|
||||
skb = __hci_cmd_sync(hdev, 0xfc20, frag_len + 1, dl_cmd,
|
||||
HCI_INIT_TIMEOUT);
|
||||
if (IS_ERR(skb)) {
|
||||
BT_ERR("%s: download fw command failed (%ld)",
|
||||
hdev->name, PTR_ERR(skb));
|
||||
ret = -PTR_ERR(skb);
|
||||
goto out;
|
||||
}
|
||||
|
||||
if (skb->len != sizeof(*dl_resp)) {
|
||||
BT_ERR("%s: download fw event length mismatch",
|
||||
hdev->name);
|
||||
kfree_skb(skb);
|
||||
ret = -EIO;
|
||||
goto out;
|
||||
}
|
||||
|
||||
dl_resp = (struct rtl_download_response *)skb->data;
|
||||
if (dl_resp->status != 0) {
|
||||
kfree_skb(skb);
|
||||
ret = bt_to_errno(dl_resp->status);
|
||||
goto out;
|
||||
}
|
||||
|
||||
kfree_skb(skb);
|
||||
data += RTL_FRAG_LEN;
|
||||
}
|
||||
|
||||
out:
|
||||
kfree(dl_cmd);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int btusb_setup_rtl8723a(struct hci_dev *hdev)
|
||||
{
|
||||
struct btusb_data *data = dev_get_drvdata(&hdev->dev);
|
||||
struct usb_device *udev = interface_to_usbdev(data->intf);
|
||||
const struct firmware *fw;
|
||||
int ret;
|
||||
|
||||
BT_INFO("%s: rtl: loading rtl_bt/rtl8723a_fw.bin", hdev->name);
|
||||
ret = request_firmware(&fw, "rtl_bt/rtl8723a_fw.bin", &udev->dev);
|
||||
if (ret < 0) {
|
||||
BT_ERR("%s: Failed to load rtl_bt/rtl8723a_fw.bin", hdev->name);
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (fw->size < 8) {
|
||||
ret = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
|
||||
/* Check that the firmware doesn't have the epatch signature
|
||||
* (which is only for RTL8723B and newer).
|
||||
*/
|
||||
if (!memcmp(fw->data, RTL_EPATCH_SIGNATURE, 8)) {
|
||||
BT_ERR("%s: unexpected EPATCH signature!", hdev->name);
|
||||
ret = -EINVAL;
|
||||
goto out;
|
||||
}
|
||||
|
||||
ret = rtl_download_firmware(hdev, fw->data, fw->size);
|
||||
|
||||
out:
|
||||
release_firmware(fw);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int btusb_setup_rtl8723b(struct hci_dev *hdev, u16 lmp_subver,
|
||||
const char *fw_name)
|
||||
{
|
||||
struct btusb_data *data = dev_get_drvdata(&hdev->dev);
|
||||
struct usb_device *udev = interface_to_usbdev(data->intf);
|
||||
unsigned char *fw_data = NULL;
|
||||
const struct firmware *fw;
|
||||
int ret;
|
||||
|
||||
BT_INFO("%s: rtl: loading %s", hdev->name, fw_name);
|
||||
ret = request_firmware(&fw, fw_name, &udev->dev);
|
||||
if (ret < 0) {
|
||||
BT_ERR("%s: Failed to load %s", hdev->name, fw_name);
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = rtl8723b_parse_firmware(hdev, lmp_subver, fw, &fw_data);
|
||||
if (ret < 0)
|
||||
goto out;
|
||||
|
||||
ret = rtl_download_firmware(hdev, fw_data, ret);
|
||||
kfree(fw_data);
|
||||
if (ret < 0)
|
||||
goto out;
|
||||
|
||||
out:
|
||||
release_firmware(fw);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int btusb_setup_realtek(struct hci_dev *hdev)
|
||||
{
|
||||
struct sk_buff *skb;
|
||||
struct hci_rp_read_local_version *resp;
|
||||
u16 lmp_subver;
|
||||
|
||||
skb = btusb_read_local_version(hdev);
|
||||
if (IS_ERR(skb))
|
||||
return -PTR_ERR(skb);
|
||||
|
||||
resp = (struct hci_rp_read_local_version *)skb->data;
|
||||
BT_INFO("%s: rtl: examining hci_ver=%02x hci_rev=%04x lmp_ver=%02x "
|
||||
"lmp_subver=%04x", hdev->name, resp->hci_ver, resp->hci_rev,
|
||||
resp->lmp_ver, resp->lmp_subver);
|
||||
|
||||
lmp_subver = le16_to_cpu(resp->lmp_subver);
|
||||
kfree_skb(skb);
|
||||
|
||||
/* Match a set of subver values that correspond to stock firmware,
|
||||
* which is not compatible with standard btusb.
|
||||
* If matched, upload an alternative firmware that does conform to
|
||||
* standard btusb. Once that firmware is uploaded, the subver changes
|
||||
* to a different value.
|
||||
*/
|
||||
switch (lmp_subver) {
|
||||
case RTL_ROM_LMP_8723A:
|
||||
case RTL_ROM_LMP_3499:
|
||||
return btusb_setup_rtl8723a(hdev);
|
||||
case RTL_ROM_LMP_8723B:
|
||||
return btusb_setup_rtl8723b(hdev, lmp_subver,
|
||||
"rtl_bt/rtl8723b_fw.bin");
|
||||
case RTL_ROM_LMP_8821A:
|
||||
return btusb_setup_rtl8723b(hdev, lmp_subver,
|
||||
"rtl_bt/rtl8821a_fw.bin");
|
||||
case RTL_ROM_LMP_8761A:
|
||||
return btusb_setup_rtl8723b(hdev, lmp_subver,
|
||||
"rtl_bt/rtl8761a_fw.bin");
|
||||
default:
|
||||
BT_INFO("rtl: assuming no firmware upload needed.");
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
static const struct firmware *btusb_setup_intel_get_fw(struct hci_dev *hdev,
|
||||
struct intel_version *ver)
|
||||
{
|
||||
@@ -2577,7 +2973,7 @@ static int btusb_setup_qca(struct hci_dev *hdev)
|
||||
int i, err;
|
||||
|
||||
err = btusb_qca_send_vendor_req(hdev, QCA_GET_TARGET_VERSION, &ver,
|
||||
sizeof(ver));
|
||||
sizeof(ver));
|
||||
if (err < 0)
|
||||
return err;
|
||||
|
||||
@@ -2776,6 +3172,9 @@ static int btusb_probe(struct usb_interface *intf,
|
||||
hdev->set_bdaddr = btusb_set_bdaddr_ath3012;
|
||||
}
|
||||
|
||||
if (id->driver_info & BTUSB_REALTEK)
|
||||
hdev->setup = btusb_setup_realtek;
|
||||
|
||||
if (id->driver_info & BTUSB_AMP) {
|
||||
/* AMP controllers do not support SCO packets */
|
||||
data->isoc = NULL;
|
||||
|
||||
+68
-40
@@ -95,7 +95,6 @@ static void ath_hci_uart_work(struct work_struct *work)
|
||||
hci_uart_tx_wakeup(hu);
|
||||
}
|
||||
|
||||
/* Initialize protocol */
|
||||
static int ath_open(struct hci_uart *hu)
|
||||
{
|
||||
struct ath_struct *ath;
|
||||
@@ -116,19 +115,6 @@ static int ath_open(struct hci_uart *hu)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Flush protocol data */
|
||||
static int ath_flush(struct hci_uart *hu)
|
||||
{
|
||||
struct ath_struct *ath = hu->priv;
|
||||
|
||||
BT_DBG("hu %p", hu);
|
||||
|
||||
skb_queue_purge(&ath->txq);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Close protocol */
|
||||
static int ath_close(struct hci_uart *hu)
|
||||
{
|
||||
struct ath_struct *ath = hu->priv;
|
||||
@@ -147,9 +133,73 @@ static int ath_close(struct hci_uart *hu)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int ath_flush(struct hci_uart *hu)
|
||||
{
|
||||
struct ath_struct *ath = hu->priv;
|
||||
|
||||
BT_DBG("hu %p", hu);
|
||||
|
||||
skb_queue_purge(&ath->txq);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int ath_set_bdaddr(struct hci_dev *hdev, const bdaddr_t *bdaddr)
|
||||
{
|
||||
struct sk_buff *skb;
|
||||
u8 buf[10];
|
||||
int err;
|
||||
|
||||
buf[0] = 0x01;
|
||||
buf[1] = 0x01;
|
||||
buf[2] = 0x00;
|
||||
buf[3] = sizeof(bdaddr_t);
|
||||
memcpy(buf + 4, bdaddr, sizeof(bdaddr_t));
|
||||
|
||||
skb = __hci_cmd_sync(hdev, 0xfc0b, sizeof(buf), buf, HCI_INIT_TIMEOUT);
|
||||
if (IS_ERR(skb)) {
|
||||
err = PTR_ERR(skb);
|
||||
BT_ERR("%s: Change address command failed (%d)",
|
||||
hdev->name, err);
|
||||
return err;
|
||||
}
|
||||
kfree_skb(skb);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int ath_setup(struct hci_uart *hu)
|
||||
{
|
||||
BT_DBG("hu %p", hu);
|
||||
|
||||
hu->hdev->set_bdaddr = ath_set_bdaddr;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct h4_recv_pkt ath_recv_pkts[] = {
|
||||
{ H4_RECV_ACL, .recv = hci_recv_frame },
|
||||
{ H4_RECV_SCO, .recv = hci_recv_frame },
|
||||
{ H4_RECV_EVENT, .recv = hci_recv_frame },
|
||||
};
|
||||
|
||||
static int ath_recv(struct hci_uart *hu, const void *data, int count)
|
||||
{
|
||||
struct ath_struct *ath = hu->priv;
|
||||
|
||||
ath->rx_skb = h4_recv_buf(hu->hdev, ath->rx_skb, data, count,
|
||||
ath_recv_pkts, ARRAY_SIZE(ath_recv_pkts));
|
||||
if (IS_ERR(ath->rx_skb)) {
|
||||
int err = PTR_ERR(ath->rx_skb);
|
||||
BT_ERR("%s: Frame reassembly failed (%d)", hu->hdev->name, err);
|
||||
return err;
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
#define HCI_OP_ATH_SLEEP 0xFC04
|
||||
|
||||
/* Enqueue frame for transmittion */
|
||||
static int ath_enqueue(struct hci_uart *hu, struct sk_buff *skb)
|
||||
{
|
||||
struct ath_struct *ath = hu->priv;
|
||||
@@ -159,8 +209,7 @@ static int ath_enqueue(struct hci_uart *hu, struct sk_buff *skb)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Update power management enable flag with parameters of
|
||||
/* Update power management enable flag with parameters of
|
||||
* HCI sleep enable vendor specific HCI command.
|
||||
*/
|
||||
if (bt_cb(skb)->pkt_type == HCI_COMMAND_PKT) {
|
||||
@@ -190,37 +239,16 @@ static struct sk_buff *ath_dequeue(struct hci_uart *hu)
|
||||
return skb_dequeue(&ath->txq);
|
||||
}
|
||||
|
||||
static const struct h4_recv_pkt ath_recv_pkts[] = {
|
||||
{ H4_RECV_ACL, .recv = hci_recv_frame },
|
||||
{ H4_RECV_SCO, .recv = hci_recv_frame },
|
||||
{ H4_RECV_EVENT, .recv = hci_recv_frame },
|
||||
};
|
||||
|
||||
/* Recv data */
|
||||
static int ath_recv(struct hci_uart *hu, const void *data, int count)
|
||||
{
|
||||
struct ath_struct *ath = hu->priv;
|
||||
|
||||
ath->rx_skb = h4_recv_buf(hu->hdev, ath->rx_skb, data, count,
|
||||
ath_recv_pkts, ARRAY_SIZE(ath_recv_pkts));
|
||||
if (IS_ERR(ath->rx_skb)) {
|
||||
int err = PTR_ERR(ath->rx_skb);
|
||||
BT_ERR("%s: Frame reassembly failed (%d)", hu->hdev->name, err);
|
||||
return err;
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
static const struct hci_uart_proto athp = {
|
||||
.id = HCI_UART_ATH3K,
|
||||
.name = "ATH3K",
|
||||
.open = ath_open,
|
||||
.close = ath_close,
|
||||
.flush = ath_flush,
|
||||
.setup = ath_setup,
|
||||
.recv = ath_recv,
|
||||
.enqueue = ath_enqueue,
|
||||
.dequeue = ath_dequeue,
|
||||
.flush = ath_flush,
|
||||
};
|
||||
|
||||
int __init ath_init(void)
|
||||
|
||||
@@ -509,10 +509,11 @@ static int xcan_rx(struct net_device *ndev)
|
||||
cf->can_id |= CAN_RTR_FLAG;
|
||||
}
|
||||
|
||||
if (!(id_xcan & XCAN_IDR_SRR_MASK)) {
|
||||
data[0] = priv->read_reg(priv, XCAN_RXFIFO_DW1_OFFSET);
|
||||
data[1] = priv->read_reg(priv, XCAN_RXFIFO_DW2_OFFSET);
|
||||
/* DW1/DW2 must always be read to remove message from RXFIFO */
|
||||
data[0] = priv->read_reg(priv, XCAN_RXFIFO_DW1_OFFSET);
|
||||
data[1] = priv->read_reg(priv, XCAN_RXFIFO_DW2_OFFSET);
|
||||
|
||||
if (!(cf->can_id & CAN_RTR_FLAG)) {
|
||||
/* Change Xilinx CAN data format to socketCAN data format */
|
||||
if (cf->can_dlc > 0)
|
||||
*(__be32 *)(cf->data) = cpu_to_be32(data[0]);
|
||||
|
||||
@@ -1469,6 +1469,9 @@ static void __exit mv88e6xxx_cleanup(void)
|
||||
#if IS_ENABLED(CONFIG_NET_DSA_MV88E6171)
|
||||
unregister_switch_driver(&mv88e6171_switch_driver);
|
||||
#endif
|
||||
#if IS_ENABLED(CONFIG_NET_DSA_MV88E6352)
|
||||
unregister_switch_driver(&mv88e6352_switch_driver);
|
||||
#endif
|
||||
#if IS_ENABLED(CONFIG_NET_DSA_MV88E6123_61_65)
|
||||
unregister_switch_driver(&mv88e6123_61_65_switch_driver);
|
||||
#endif
|
||||
|
||||
@@ -180,6 +180,7 @@ config SUNLANCE
|
||||
config AMD_XGBE
|
||||
tristate "AMD 10GbE Ethernet driver"
|
||||
depends on (OF_NET || ACPI) && HAS_IOMEM && HAS_DMA
|
||||
depends on ARM64 || COMPILE_TEST
|
||||
select PHYLIB
|
||||
select AMD_XGBE_PHY
|
||||
select BITREVERSE
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
config NET_XGENE
|
||||
tristate "APM X-Gene SoC Ethernet Driver"
|
||||
depends on HAS_DMA
|
||||
depends on ARCH_XGENE || COMPILE_TEST
|
||||
select PHYLIB
|
||||
help
|
||||
This is the Ethernet driver for the on-chip ethernet interface on the
|
||||
|
||||
@@ -4786,6 +4786,11 @@ int bnx2x_change_mtu(struct net_device *dev, int new_mtu)
|
||||
{
|
||||
struct bnx2x *bp = netdev_priv(dev);
|
||||
|
||||
if (pci_num_vf(bp->pdev)) {
|
||||
DP(BNX2X_MSG_IOV, "VFs are enabled, can not change MTU\n");
|
||||
return -EPERM;
|
||||
}
|
||||
|
||||
if (bp->recovery_state != BNX2X_RECOVERY_DONE) {
|
||||
BNX2X_ERR("Can't perform change MTU during parity recovery\n");
|
||||
return -EAGAIN;
|
||||
@@ -4938,11 +4943,6 @@ int bnx2x_resume(struct pci_dev *pdev)
|
||||
}
|
||||
bp = netdev_priv(dev);
|
||||
|
||||
if (pci_num_vf(bp->pdev)) {
|
||||
DP(BNX2X_MSG_IOV, "VFs are enabled, can not change MTU\n");
|
||||
return -EPERM;
|
||||
}
|
||||
|
||||
if (bp->recovery_state != BNX2X_RECOVERY_DONE) {
|
||||
BNX2X_ERR("Handling parity error recovery. Try again later\n");
|
||||
return -EAGAIN;
|
||||
|
||||
@@ -13371,8 +13371,13 @@ static int bnx2x_init_one(struct pci_dev *pdev,
|
||||
/* Management FW 'remembers' living interfaces. Allow it some time
|
||||
* to forget previously living interfaces, allowing a proper re-load.
|
||||
*/
|
||||
if (is_kdump_kernel())
|
||||
msleep(5000);
|
||||
if (is_kdump_kernel()) {
|
||||
ktime_t now = ktime_get_boottime();
|
||||
ktime_t fw_ready_time = ktime_set(5, 0);
|
||||
|
||||
if (ktime_before(now, fw_ready_time))
|
||||
msleep(ktime_ms_delta(fw_ready_time, now));
|
||||
}
|
||||
|
||||
/* An estimated maximum supported CoS number according to the chip
|
||||
* version.
|
||||
|
||||
@@ -981,7 +981,7 @@ static irqreturn_t macb_interrupt(int irq, void *dev_id)
|
||||
struct macb_queue *queue = dev_id;
|
||||
struct macb *bp = queue->bp;
|
||||
struct net_device *dev = bp->dev;
|
||||
u32 status;
|
||||
u32 status, ctrl;
|
||||
|
||||
status = queue_readl(queue, ISR);
|
||||
|
||||
@@ -1037,6 +1037,15 @@ static irqreturn_t macb_interrupt(int irq, void *dev_id)
|
||||
* add that if/when we get our hands on a full-blown MII PHY.
|
||||
*/
|
||||
|
||||
if (status & MACB_BIT(RXUBR)) {
|
||||
ctrl = macb_readl(bp, NCR);
|
||||
macb_writel(bp, NCR, ctrl & ~MACB_BIT(RE));
|
||||
macb_writel(bp, NCR, ctrl | MACB_BIT(RE));
|
||||
|
||||
if (bp->caps & MACB_CAPS_ISR_CLEAR_ON_WRITE)
|
||||
macb_writel(bp, ISR, MACB_BIT(RXUBR));
|
||||
}
|
||||
|
||||
if (status & MACB_BIT(ISR_ROVR)) {
|
||||
/* We missed at least one packet */
|
||||
if (macb_is_gem(bp))
|
||||
|
||||
@@ -40,6 +40,7 @@
|
||||
#include <linux/ptp_classify.h>
|
||||
#include <linux/mii.h>
|
||||
#include <linux/mdio.h>
|
||||
#include <linux/pm_qos.h>
|
||||
#include "hw.h"
|
||||
|
||||
struct e1000_info;
|
||||
|
||||
@@ -610,7 +610,7 @@ static bool fm10k_clean_rx_irq(struct fm10k_q_vector *q_vector,
|
||||
unsigned int total_bytes = 0, total_packets = 0;
|
||||
u16 cleaned_count = fm10k_desc_unused(rx_ring);
|
||||
|
||||
do {
|
||||
while (likely(total_packets < budget)) {
|
||||
union fm10k_rx_desc *rx_desc;
|
||||
|
||||
/* return some buffers to hardware, one at a time is too slow */
|
||||
@@ -659,7 +659,7 @@ static bool fm10k_clean_rx_irq(struct fm10k_q_vector *q_vector,
|
||||
|
||||
/* update budget accounting */
|
||||
total_packets++;
|
||||
} while (likely(total_packets < budget));
|
||||
}
|
||||
|
||||
/* place incomplete frames back on ring for completion */
|
||||
rx_ring->skb = skb;
|
||||
|
||||
@@ -1036,7 +1036,7 @@ static void igb_reset_q_vector(struct igb_adapter *adapter, int v_idx)
|
||||
adapter->tx_ring[q_vector->tx.ring->queue_index] = NULL;
|
||||
|
||||
if (q_vector->rx.ring)
|
||||
adapter->tx_ring[q_vector->rx.ring->queue_index] = NULL;
|
||||
adapter->rx_ring[q_vector->rx.ring->queue_index] = NULL;
|
||||
|
||||
netif_napi_del(&q_vector->napi);
|
||||
|
||||
@@ -1207,6 +1207,8 @@ static int igb_alloc_q_vector(struct igb_adapter *adapter,
|
||||
q_vector = adapter->q_vector[v_idx];
|
||||
if (!q_vector)
|
||||
q_vector = kzalloc(size, GFP_KERNEL);
|
||||
else
|
||||
memset(q_vector, 0, size);
|
||||
if (!q_vector)
|
||||
return -ENOMEM;
|
||||
|
||||
|
||||
@@ -3612,7 +3612,7 @@ static int ixgbevf_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
|
||||
u8 *dst_mac = skb_header_pointer(skb, 0, 0, NULL);
|
||||
|
||||
if (!dst_mac || is_link_local_ether_addr(dst_mac)) {
|
||||
dev_kfree_skb(skb);
|
||||
dev_kfree_skb_any(skb);
|
||||
return NETDEV_TX_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -139,7 +139,7 @@ static unsigned long en_stats_adder(__be64 *start, __be64 *next, int num)
|
||||
int i;
|
||||
int offset = next - start;
|
||||
|
||||
for (i = 0; i <= num; i++) {
|
||||
for (i = 0; i < num; i++) {
|
||||
ret += be64_to_cpu(*curr);
|
||||
curr += offset;
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user