Skip to content

Commit 98f75b8

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller: 1) If the user gives us a msg_namelen of 0, don't try to interpret anything pointed to by msg_name. From Ani Sinha. 2) Fix some bnx2i/bnx2fc randconfig compilation errors. The gist of the issue is that we firstly have drivers that span both SCSI and networking. And at the top of that chain of dependencies we have things like SCSI_FC_ATTRS and SCSI_NETLINK which are selected. But since select is a sledgehammer and ignores dependencies, everything to select's SCSI_FC_ATTRS and/or SCSI_NETLINK has to also explicitly select their dependencies and so on and so forth. Generally speaking 'select' is supposed to only be used for child nodes, those which have no dependencies of their own. And this whole chain of dependencies in the scsi layer violates that rather strongly. So just make SCSI_NETLINK depend upon it's dependencies, and so on and so forth for the things selecting it (either directly or indirectly). From Anish Bhatt and Randy Dunlap. 3) Fix generation of blackhole routes in IPSEC, from Steffen Klassert. 4) Actually notice netdev feature changes in rtl_open() code, from Hayes Wang. 5) Fix divide by zero in bond enslaving, from Nikolay Aleksandrov. 6) Missing memory barrier in sunvnet driver, from David Stevens. 7) Don't leave anycast addresses around when ipv6 interface is destroyed, from Sabrina Dubroca. 8) Don't call efx_{arch}_filter_sync_rx_mode before addr_list_lock is initialized in SFC driver, from Edward Cree. 9) Fix missing DMA error checking in 3c59x, from Neal Horman. 10) Openvswitch doesn't emit OVS_FLOW_CMD_NEW notifications accidently, fix from Samuel Gauthier. 11) pch_gbe needs to select NET_PTP_CLASSIFY otherwise we can get a build error. 12) Fix macvlan regression wherein we stopped emitting broadcast/multicast frames over software devices. From Nicolas Dichtel. 13) Fix infiniband bug due to unintended overflow of skb->cb[], from Eric Dumazet. And add an assertion so this doesn't happen again. 14) dm9000_parse_dt() should return error pointers, not NULL. From Tobias Klauser. 15) IP tunneling code uses this_cpu_ptr() in preemptible contexts, fix from Eric Dumazet. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (87 commits) net: bcmgenet: call bcmgenet_dma_teardown in bcmgenet_fini_dma net: bcmgenet: fix TX reclaim accounting for fragments ipv4: do not use this_cpu_ptr() in preemptible context dm9000: Return an ERR_PTR() in all error conditions of dm9000_parse_dt() r8169: fix an if condition r8152: disable ALDPS ipoib: validate struct ipoib_cb size net: sched: shrink struct qdisc_skb_cb to 28 bytes tg3: Work around HW/FW limitations with vlan encapsulated frames macvlan: allow to enqueue broadcast pkt on virtual device pch_gbe: 'select' NET_PTP_CLASSIFY. scsi: Use 'depends' with LIBFC instead of 'select'. openvswitch: restore OVS_FLOW_CMD_NEW notifications genetlink: add function genl_has_listeners() lib: rhashtable: remove second linux/log2.h inclusion net: allow macvlans to move to net namespace 3c59x: Fix bad offset spec in skb_frag_dma_map 3c59x: Add dma error checking and recovery sparc: bpf_jit: fix support for ldx/stx mem and SKF_AD_VLAN_TAG can: at91_can: add missing prepare and unprepare of the clock ...
2 parents 9478303 + e18b7fa commit 98f75b8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+828
-355
lines changed

Documentation/networking/filter.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -462,9 +462,9 @@ JIT compiler
462462
------------
463463

464464
The Linux kernel has a built-in BPF JIT compiler for x86_64, SPARC, PowerPC,
465-
ARM and s390 and can be enabled through CONFIG_BPF_JIT. The JIT compiler is
466-
transparently invoked for each attached filter from user space or for internal
467-
kernel users if it has been previously enabled by root:
465+
ARM, MIPS and s390 and can be enabled through CONFIG_BPF_JIT. The JIT compiler
466+
is transparently invoked for each attached filter from user space or for
467+
internal kernel users if it has been previously enabled by root:
468468

469469
echo 1 > /proc/sys/net/core/bpf_jit_enable
470470

arch/sparc/net/bpf_jit_comp.c

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -234,12 +234,18 @@ do { BUILD_BUG_ON(FIELD_SIZEOF(STRUCT, FIELD) != sizeof(u8)); \
234234
__emit_load8(BASE, STRUCT, FIELD, DEST); \
235235
} while (0)
236236

237-
#define emit_ldmem(OFF, DEST) \
238-
do { *prog++ = LD32I | RS1(FP) | S13(-(OFF)) | RD(DEST); \
237+
#ifdef CONFIG_SPARC64
238+
#define BIAS (STACK_BIAS - 4)
239+
#else
240+
#define BIAS (-4)
241+
#endif
242+
243+
#define emit_ldmem(OFF, DEST) \
244+
do { *prog++ = LD32I | RS1(SP) | S13(BIAS - (OFF)) | RD(DEST); \
239245
} while (0)
240246

241-
#define emit_stmem(OFF, SRC) \
242-
do { *prog++ = LD32I | RS1(FP) | S13(-(OFF)) | RD(SRC); \
247+
#define emit_stmem(OFF, SRC) \
248+
do { *prog++ = ST32I | RS1(SP) | S13(BIAS - (OFF)) | RD(SRC); \
243249
} while (0)
244250

245251
#ifdef CONFIG_SMP
@@ -615,10 +621,11 @@ void bpf_jit_compile(struct bpf_prog *fp)
615621
case BPF_ANC | SKF_AD_VLAN_TAG:
616622
case BPF_ANC | SKF_AD_VLAN_TAG_PRESENT:
617623
emit_skb_load16(vlan_tci, r_A);
618-
if (code == (BPF_ANC | SKF_AD_VLAN_TAG)) {
619-
emit_andi(r_A, VLAN_VID_MASK, r_A);
624+
if (code != (BPF_ANC | SKF_AD_VLAN_TAG)) {
625+
emit_alu_K(SRL, 12);
626+
emit_andi(r_A, 1, r_A);
620627
} else {
621-
emit_loadimm(VLAN_TAG_PRESENT, r_TMP);
628+
emit_loadimm(~VLAN_TAG_PRESENT, r_TMP);
622629
emit_and(r_A, r_TMP, r_A);
623630
}
624631
break;
@@ -630,15 +637,19 @@ void bpf_jit_compile(struct bpf_prog *fp)
630637
emit_loadimm(K, r_X);
631638
break;
632639
case BPF_LD | BPF_MEM:
640+
seen |= SEEN_MEM;
633641
emit_ldmem(K * 4, r_A);
634642
break;
635643
case BPF_LDX | BPF_MEM:
644+
seen |= SEEN_MEM | SEEN_XREG;
636645
emit_ldmem(K * 4, r_X);
637646
break;
638647
case BPF_ST:
648+
seen |= SEEN_MEM;
639649
emit_stmem(K * 4, r_A);
640650
break;
641651
case BPF_STX:
652+
seen |= SEEN_MEM | SEEN_XREG;
642653
emit_stmem(K * 4, r_X);
643654
break;
644655

drivers/infiniband/hw/mlx4/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1680,7 +1680,7 @@ static void mlx4_ib_update_qps(struct mlx4_ib_dev *ibdev,
16801680
goto unlock;
16811681

16821682
update_params.smac_index = new_smac_index;
1683-
if (mlx4_update_qp(ibdev->dev, &qp->mqp, MLX4_UPDATE_QP_SMAC,
1683+
if (mlx4_update_qp(ibdev->dev, qp->mqp.qpn, MLX4_UPDATE_QP_SMAC,
16841684
&update_params)) {
16851685
release_mac = new_smac;
16861686
goto unlock;

drivers/infiniband/hw/mlx4/qp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1682,7 +1682,7 @@ static int __mlx4_ib_modify_qp(struct ib_qp *ibqp,
16821682
MLX4_IB_LINK_TYPE_ETH;
16831683
if (dev->dev->caps.tunnel_offload_mode == MLX4_TUNNEL_OFFLOAD_MODE_VXLAN) {
16841684
/* set QP to receive both tunneled & non-tunneled packets */
1685-
if (!(context->flags & (1 << MLX4_RSS_QPC_FLAG_OFFSET)))
1685+
if (!(context->flags & cpu_to_be32(1 << MLX4_RSS_QPC_FLAG_OFFSET)))
16861686
context->srqn = cpu_to_be32(7 << 28);
16871687
}
16881688
}

drivers/infiniband/ulp/ipoib/ipoib.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,12 @@ struct ipoib_cb {
131131
u8 hwaddr[INFINIBAND_ALEN];
132132
};
133133

134+
static inline struct ipoib_cb *ipoib_skb_cb(const struct sk_buff *skb)
135+
{
136+
BUILD_BUG_ON(sizeof(skb->cb) < sizeof(struct ipoib_cb));
137+
return (struct ipoib_cb *)skb->cb;
138+
}
139+
134140
/* Used for all multicast joins (broadcast, IPv4 mcast and IPv6 mcast) */
135141
struct ipoib_mcast {
136142
struct ib_sa_mcmember_rec mcmember;

drivers/infiniband/ulp/ipoib/ipoib_main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -716,7 +716,7 @@ static int ipoib_start_xmit(struct sk_buff *skb, struct net_device *dev)
716716
{
717717
struct ipoib_dev_priv *priv = netdev_priv(dev);
718718
struct ipoib_neigh *neigh;
719-
struct ipoib_cb *cb = (struct ipoib_cb *) skb->cb;
719+
struct ipoib_cb *cb = ipoib_skb_cb(skb);
720720
struct ipoib_header *header;
721721
unsigned long flags;
722722

@@ -813,7 +813,7 @@ static int ipoib_hard_header(struct sk_buff *skb,
813813
const void *daddr, const void *saddr, unsigned len)
814814
{
815815
struct ipoib_header *header;
816-
struct ipoib_cb *cb = (struct ipoib_cb *) skb->cb;
816+
struct ipoib_cb *cb = ipoib_skb_cb(skb);
817817

818818
header = (struct ipoib_header *) skb_push(skb, sizeof *header);
819819

drivers/message/fusion/Kconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ config FUSION_SPI
2929
config FUSION_FC
3030
tristate "Fusion MPT ScsiHost drivers for FC"
3131
depends on PCI && SCSI
32-
select SCSI_FC_ATTRS
32+
depends on SCSI_FC_ATTRS
3333
---help---
3434
SCSI HOST support for a Fiber Channel host adapters.
3535

drivers/net/bonding/bond_main.c

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ MODULE_PARM_DESC(fail_over_mac, "For active-backup, do not set all slaves to "
175175
"the same MAC; 0 for none (default), "
176176
"1 for active, 2 for follow");
177177
module_param(all_slaves_active, int, 0);
178-
MODULE_PARM_DESC(all_slaves_active, "Keep all frames received on an interface"
178+
MODULE_PARM_DESC(all_slaves_active, "Keep all frames received on an interface "
179179
"by setting active flag for all slaves; "
180180
"0 for never (default), 1 for always.");
181181
module_param(resend_igmp, int, 0);
@@ -3659,8 +3659,14 @@ static int bond_xmit_roundrobin(struct sk_buff *skb, struct net_device *bond_dev
36593659
else
36603660
bond_xmit_slave_id(bond, skb, 0);
36613661
} else {
3662-
slave_id = bond_rr_gen_slave_id(bond);
3663-
bond_xmit_slave_id(bond, skb, slave_id % bond->slave_cnt);
3662+
int slave_cnt = ACCESS_ONCE(bond->slave_cnt);
3663+
3664+
if (likely(slave_cnt)) {
3665+
slave_id = bond_rr_gen_slave_id(bond);
3666+
bond_xmit_slave_id(bond, skb, slave_id % slave_cnt);
3667+
} else {
3668+
dev_kfree_skb_any(skb);
3669+
}
36643670
}
36653671

36663672
return NETDEV_TX_OK;
@@ -3691,8 +3697,13 @@ static int bond_xmit_activebackup(struct sk_buff *skb, struct net_device *bond_d
36913697
static int bond_xmit_xor(struct sk_buff *skb, struct net_device *bond_dev)
36923698
{
36933699
struct bonding *bond = netdev_priv(bond_dev);
3700+
int slave_cnt = ACCESS_ONCE(bond->slave_cnt);
36943701

3695-
bond_xmit_slave_id(bond, skb, bond_xmit_hash(bond, skb) % bond->slave_cnt);
3702+
if (likely(slave_cnt))
3703+
bond_xmit_slave_id(bond, skb,
3704+
bond_xmit_hash(bond, skb) % slave_cnt);
3705+
else
3706+
dev_kfree_skb_any(skb);
36963707

36973708
return NETDEV_TX_OK;
36983709
}

drivers/net/can/at91_can.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1123,7 +1123,9 @@ static int at91_open(struct net_device *dev)
11231123
struct at91_priv *priv = netdev_priv(dev);
11241124
int err;
11251125

1126-
clk_enable(priv->clk);
1126+
err = clk_prepare_enable(priv->clk);
1127+
if (err)
1128+
return err;
11271129

11281130
/* check or determine and set bittime */
11291131
err = open_candev(dev);
@@ -1149,7 +1151,7 @@ static int at91_open(struct net_device *dev)
11491151
out_close:
11501152
close_candev(dev);
11511153
out:
1152-
clk_disable(priv->clk);
1154+
clk_disable_unprepare(priv->clk);
11531155

11541156
return err;
11551157
}
@@ -1166,7 +1168,7 @@ static int at91_close(struct net_device *dev)
11661168
at91_chip_stop(dev, CAN_STATE_STOPPED);
11671169

11681170
free_irq(dev->irq, dev);
1169-
clk_disable(priv->clk);
1171+
clk_disable_unprepare(priv->clk);
11701172

11711173
close_candev(dev);
11721174

drivers/net/can/c_can/c_can_platform.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,14 +97,14 @@ static void c_can_hw_raminit_ti(const struct c_can_priv *priv, bool enable)
9797
ctrl |= CAN_RAMINIT_DONE_MASK(priv->instance);
9898
writel(ctrl, priv->raminit_ctrlreg);
9999
ctrl &= ~CAN_RAMINIT_DONE_MASK(priv->instance);
100-
c_can_hw_raminit_wait_ti(priv, ctrl, mask);
100+
c_can_hw_raminit_wait_ti(priv, mask, ctrl);
101101

102102
if (enable) {
103103
/* Set start bit and wait for the done bit. */
104104
ctrl |= CAN_RAMINIT_START_MASK(priv->instance);
105105
writel(ctrl, priv->raminit_ctrlreg);
106106
ctrl |= CAN_RAMINIT_DONE_MASK(priv->instance);
107-
c_can_hw_raminit_wait_ti(priv, ctrl, mask);
107+
c_can_hw_raminit_wait_ti(priv, mask, ctrl);
108108
}
109109
spin_unlock(&raminit_lock);
110110
}

drivers/net/can/flexcan.c

Lines changed: 44 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262
#define FLEXCAN_MCR_BCC BIT(16)
6363
#define FLEXCAN_MCR_LPRIO_EN BIT(13)
6464
#define FLEXCAN_MCR_AEN BIT(12)
65-
#define FLEXCAN_MCR_MAXMB(x) ((x) & 0x1f)
65+
#define FLEXCAN_MCR_MAXMB(x) ((x) & 0x7f)
6666
#define FLEXCAN_MCR_IDAM_A (0 << 8)
6767
#define FLEXCAN_MCR_IDAM_B (1 << 8)
6868
#define FLEXCAN_MCR_IDAM_C (2 << 8)
@@ -125,7 +125,9 @@
125125
FLEXCAN_ESR_BOFF_INT | FLEXCAN_ESR_ERR_INT)
126126

127127
/* FLEXCAN interrupt flag register (IFLAG) bits */
128-
#define FLEXCAN_TX_BUF_ID 8
128+
/* Errata ERR005829 step7: Reserve first valid MB */
129+
#define FLEXCAN_TX_BUF_RESERVED 8
130+
#define FLEXCAN_TX_BUF_ID 9
129131
#define FLEXCAN_IFLAG_BUF(x) BIT(x)
130132
#define FLEXCAN_IFLAG_RX_FIFO_OVERFLOW BIT(7)
131133
#define FLEXCAN_IFLAG_RX_FIFO_WARN BIT(6)
@@ -136,6 +138,17 @@
136138

137139
/* FLEXCAN message buffers */
138140
#define FLEXCAN_MB_CNT_CODE(x) (((x) & 0xf) << 24)
141+
#define FLEXCAN_MB_CODE_RX_INACTIVE (0x0 << 24)
142+
#define FLEXCAN_MB_CODE_RX_EMPTY (0x4 << 24)
143+
#define FLEXCAN_MB_CODE_RX_FULL (0x2 << 24)
144+
#define FLEXCAN_MB_CODE_RX_OVERRRUN (0x6 << 24)
145+
#define FLEXCAN_MB_CODE_RX_RANSWER (0xa << 24)
146+
147+
#define FLEXCAN_MB_CODE_TX_INACTIVE (0x8 << 24)
148+
#define FLEXCAN_MB_CODE_TX_ABORT (0x9 << 24)
149+
#define FLEXCAN_MB_CODE_TX_DATA (0xc << 24)
150+
#define FLEXCAN_MB_CODE_TX_TANSWER (0xe << 24)
151+
139152
#define FLEXCAN_MB_CNT_SRR BIT(22)
140153
#define FLEXCAN_MB_CNT_IDE BIT(21)
141154
#define FLEXCAN_MB_CNT_RTR BIT(20)
@@ -298,7 +311,7 @@ static int flexcan_chip_enable(struct flexcan_priv *priv)
298311
flexcan_write(reg, &regs->mcr);
299312

300313
while (timeout-- && (flexcan_read(&regs->mcr) & FLEXCAN_MCR_LPM_ACK))
301-
usleep_range(10, 20);
314+
udelay(10);
302315

303316
if (flexcan_read(&regs->mcr) & FLEXCAN_MCR_LPM_ACK)
304317
return -ETIMEDOUT;
@@ -317,7 +330,7 @@ static int flexcan_chip_disable(struct flexcan_priv *priv)
317330
flexcan_write(reg, &regs->mcr);
318331

319332
while (timeout-- && !(flexcan_read(&regs->mcr) & FLEXCAN_MCR_LPM_ACK))
320-
usleep_range(10, 20);
333+
udelay(10);
321334

322335
if (!(flexcan_read(&regs->mcr) & FLEXCAN_MCR_LPM_ACK))
323336
return -ETIMEDOUT;
@@ -336,7 +349,7 @@ static int flexcan_chip_freeze(struct flexcan_priv *priv)
336349
flexcan_write(reg, &regs->mcr);
337350

338351
while (timeout-- && !(flexcan_read(&regs->mcr) & FLEXCAN_MCR_FRZ_ACK))
339-
usleep_range(100, 200);
352+
udelay(100);
340353

341354
if (!(flexcan_read(&regs->mcr) & FLEXCAN_MCR_FRZ_ACK))
342355
return -ETIMEDOUT;
@@ -355,7 +368,7 @@ static int flexcan_chip_unfreeze(struct flexcan_priv *priv)
355368
flexcan_write(reg, &regs->mcr);
356369

357370
while (timeout-- && (flexcan_read(&regs->mcr) & FLEXCAN_MCR_FRZ_ACK))
358-
usleep_range(10, 20);
371+
udelay(10);
359372

360373
if (flexcan_read(&regs->mcr) & FLEXCAN_MCR_FRZ_ACK)
361374
return -ETIMEDOUT;
@@ -370,7 +383,7 @@ static int flexcan_chip_softreset(struct flexcan_priv *priv)
370383

371384
flexcan_write(FLEXCAN_MCR_SOFTRST, &regs->mcr);
372385
while (timeout-- && (flexcan_read(&regs->mcr) & FLEXCAN_MCR_SOFTRST))
373-
usleep_range(10, 20);
386+
udelay(10);
374387

375388
if (flexcan_read(&regs->mcr) & FLEXCAN_MCR_SOFTRST)
376389
return -ETIMEDOUT;
@@ -428,6 +441,14 @@ static int flexcan_start_xmit(struct sk_buff *skb, struct net_device *dev)
428441
flexcan_write(can_id, &regs->cantxfg[FLEXCAN_TX_BUF_ID].can_id);
429442
flexcan_write(ctrl, &regs->cantxfg[FLEXCAN_TX_BUF_ID].can_ctrl);
430443

444+
/* Errata ERR005829 step8:
445+
* Write twice INACTIVE(0x8) code to first MB.
446+
*/
447+
flexcan_write(FLEXCAN_MB_CODE_TX_INACTIVE,
448+
&regs->cantxfg[FLEXCAN_TX_BUF_RESERVED].can_ctrl);
449+
flexcan_write(FLEXCAN_MB_CODE_TX_INACTIVE,
450+
&regs->cantxfg[FLEXCAN_TX_BUF_RESERVED].can_ctrl);
451+
431452
return NETDEV_TX_OK;
432453
}
433454

@@ -744,6 +765,9 @@ static irqreturn_t flexcan_irq(int irq, void *dev_id)
744765
stats->tx_bytes += can_get_echo_skb(dev, 0);
745766
stats->tx_packets++;
746767
can_led_event(dev, CAN_LED_EVENT_TX);
768+
/* after sending a RTR frame mailbox is in RX mode */
769+
flexcan_write(FLEXCAN_MB_CODE_TX_INACTIVE,
770+
&regs->cantxfg[FLEXCAN_TX_BUF_ID].can_ctrl);
747771
flexcan_write((1 << FLEXCAN_TX_BUF_ID), &regs->iflag1);
748772
netif_wake_queue(dev);
749773
}
@@ -801,6 +825,7 @@ static int flexcan_chip_start(struct net_device *dev)
801825
struct flexcan_regs __iomem *regs = priv->base;
802826
int err;
803827
u32 reg_mcr, reg_ctrl;
828+
int i;
804829

805830
/* enable module */
806831
err = flexcan_chip_enable(priv);
@@ -867,8 +892,18 @@ static int flexcan_chip_start(struct net_device *dev)
867892
netdev_dbg(dev, "%s: writing ctrl=0x%08x", __func__, reg_ctrl);
868893
flexcan_write(reg_ctrl, &regs->ctrl);
869894

870-
/* Abort any pending TX, mark Mailbox as INACTIVE */
871-
flexcan_write(FLEXCAN_MB_CNT_CODE(0x4),
895+
/* clear and invalidate all mailboxes first */
896+
for (i = FLEXCAN_TX_BUF_ID; i < ARRAY_SIZE(regs->cantxfg); i++) {
897+
flexcan_write(FLEXCAN_MB_CODE_RX_INACTIVE,
898+
&regs->cantxfg[i].can_ctrl);
899+
}
900+
901+
/* Errata ERR005829: mark first TX mailbox as INACTIVE */
902+
flexcan_write(FLEXCAN_MB_CODE_TX_INACTIVE,
903+
&regs->cantxfg[FLEXCAN_TX_BUF_RESERVED].can_ctrl);
904+
905+
/* mark TX mailbox as INACTIVE */
906+
flexcan_write(FLEXCAN_MB_CODE_TX_INACTIVE,
872907
&regs->cantxfg[FLEXCAN_TX_BUF_ID].can_ctrl);
873908

874909
/* acceptance mask/acceptance code (accept everything) */

drivers/net/can/sja1000/peak_pci.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ struct peak_pci_chan {
7070
#define PEAK_PC_104P_DEVICE_ID 0x0006 /* PCAN-PC/104+ cards */
7171
#define PEAK_PCI_104E_DEVICE_ID 0x0007 /* PCAN-PCI/104 Express cards */
7272
#define PEAK_MPCIE_DEVICE_ID 0x0008 /* The miniPCIe slot cards */
73+
#define PEAK_PCIE_OEM_ID 0x0009 /* PCAN-PCI Express OEM */
74+
#define PEAK_PCIEC34_DEVICE_ID 0x000A /* PCAN-PCI Express 34 (one channel) */
7375

7476
#define PEAK_PCI_CHAN_MAX 4
7577

@@ -87,6 +89,7 @@ static const struct pci_device_id peak_pci_tbl[] = {
8789
{PEAK_PCI_VENDOR_ID, PEAK_CPCI_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID,},
8890
#ifdef CONFIG_CAN_PEAK_PCIEC
8991
{PEAK_PCI_VENDOR_ID, PEAK_PCIEC_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID,},
92+
{PEAK_PCI_VENDOR_ID, PEAK_PCIEC34_DEVICE_ID, PCI_ANY_ID, PCI_ANY_ID,},
9093
#endif
9194
{0,}
9295
};
@@ -653,7 +656,8 @@ static int peak_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
653656
* This must be done *before* register_sja1000dev() but
654657
* *after* devices linkage
655658
*/
656-
if (pdev->device == PEAK_PCIEC_DEVICE_ID) {
659+
if (pdev->device == PEAK_PCIEC_DEVICE_ID ||
660+
pdev->device == PEAK_PCIEC34_DEVICE_ID) {
657661
err = peak_pciec_probe(pdev, dev);
658662
if (err) {
659663
dev_err(&pdev->dev,

0 commit comments

Comments
 (0)