Skip to content

Commit e5b26a8

Browse files
committed
Merge git://github.com/davem330/net
* git://github.com/davem330/net: (27 commits) xfrm: Perform a replay check after return from async codepaths fib:fix BUG_ON in fib_nl_newrule when add new fib rule ixgbe: fix possible null buffer error tg3: fix VLAN tagging regression net: pxa168: Fix build errors by including interrupt.h netconsole: switch init_netconsole() to late_initcall gianfar: Fix overflow check and return value for gfar_get_cls_all() ppp_generic: fix multilink fragment MTU calculation (again) GRETH: avoid overwrite IP-stack's IP-frags checksum GRETH: RX/TX bytes were never increased ipv6: fix a possible double free b43: Fix beacon problem in ad-hoc mode Bluetooth: add support for 2011 mac mini Bluetooth: Add MacBookAir4,1 support Bluetooth: Fixed BT ST Channel reg order r8169: do not enable the TBI for anything but the original 8169. r8169: remove erroneous processing of always set bit. r8169: fix WOL setting for 8105 and 8111evl r8169: add MODULE_FIRMWARE for the firmware of 8111evl r8169: fix the reset setting for 8111evl ...
2 parents fed678d + bcf66bf commit e5b26a8

File tree

22 files changed

+165
-80
lines changed

22 files changed

+165
-80
lines changed

drivers/bluetooth/btusb.c

+6
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,15 @@ static struct usb_device_id btusb_table[] = {
7272
/* Apple MacBookAir3,1, MacBookAir3,2 */
7373
{ USB_DEVICE(0x05ac, 0x821b) },
7474

75+
/* Apple MacBookAir4,1 */
76+
{ USB_DEVICE(0x05ac, 0x821f) },
77+
7578
/* Apple MacBookPro8,2 */
7679
{ USB_DEVICE(0x05ac, 0x821a) },
7780

81+
/* Apple MacMini5,1 */
82+
{ USB_DEVICE(0x05ac, 0x8281) },
83+
7884
/* AVM BlueFRITZ! USB v2.0 */
7985
{ USB_DEVICE(0x057c, 0x3800) },
8086

drivers/bluetooth/btwilink.c

+8-8
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,13 @@ static long st_receive(void *priv_data, struct sk_buff *skb)
124124
/* ------- Interfaces to HCI layer ------ */
125125
/* protocol structure registered with shared transport */
126126
static struct st_proto_s ti_st_proto[MAX_BT_CHNL_IDS] = {
127+
{
128+
.chnl_id = HCI_EVENT_PKT, /* HCI Events */
129+
.hdr_len = sizeof(struct hci_event_hdr),
130+
.offset_len_in_hdr = offsetof(struct hci_event_hdr, plen),
131+
.len_size = 1, /* sizeof(plen) in struct hci_event_hdr */
132+
.reserve = 8,
133+
},
127134
{
128135
.chnl_id = HCI_ACLDATA_PKT, /* ACL */
129136
.hdr_len = sizeof(struct hci_acl_hdr),
@@ -138,13 +145,6 @@ static struct st_proto_s ti_st_proto[MAX_BT_CHNL_IDS] = {
138145
.len_size = 1, /* sizeof(dlen) in struct hci_sco_hdr */
139146
.reserve = 8,
140147
},
141-
{
142-
.chnl_id = HCI_EVENT_PKT, /* HCI Events */
143-
.hdr_len = sizeof(struct hci_event_hdr),
144-
.offset_len_in_hdr = offsetof(struct hci_event_hdr, plen),
145-
.len_size = 1, /* sizeof(plen) in struct hci_event_hdr */
146-
.reserve = 8,
147-
},
148148
};
149149

150150
/* Called from HCI core to initialize the device */
@@ -240,7 +240,7 @@ static int ti_st_close(struct hci_dev *hdev)
240240
if (!test_and_clear_bit(HCI_RUNNING, &hdev->flags))
241241
return 0;
242242

243-
for (i = 0; i < MAX_BT_CHNL_IDS; i++) {
243+
for (i = MAX_BT_CHNL_IDS-1; i >= 0; i--) {
244244
err = st_unregister(&ti_st_proto[i]);
245245
if (err)
246246
BT_ERR("st_unregister(%d) failed with error %d",

drivers/net/gianfar_ethtool.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -1669,10 +1669,10 @@ static int gfar_get_cls_all(struct gfar_private *priv,
16691669
u32 i = 0;
16701670

16711671
list_for_each_entry(comp, &priv->rx_list.list, list) {
1672-
if (i <= cmd->rule_cnt) {
1673-
rule_locs[i] = comp->fs.location;
1674-
i++;
1675-
}
1672+
if (i == cmd->rule_cnt)
1673+
return -EMSGSIZE;
1674+
rule_locs[i] = comp->fs.location;
1675+
i++;
16761676
}
16771677

16781678
cmd->data = MAX_FILER_IDX;

drivers/net/greth.c

+10-2
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,7 @@ greth_start_xmit(struct sk_buff *skb, struct net_device *dev)
428428
dma_sync_single_for_device(greth->dev, dma_addr, skb->len, DMA_TO_DEVICE);
429429

430430
status = GRETH_BD_EN | GRETH_BD_IE | (skb->len & GRETH_BD_LEN);
431+
greth->tx_bufs_length[greth->tx_next] = skb->len & GRETH_BD_LEN;
431432

432433
/* Wrap around descriptor ring */
433434
if (greth->tx_next == GRETH_TXBD_NUM_MASK) {
@@ -490,7 +491,8 @@ greth_start_xmit_gbit(struct sk_buff *skb, struct net_device *dev)
490491
if (nr_frags != 0)
491492
status = GRETH_TXBD_MORE;
492493

493-
status |= GRETH_TXBD_CSALL;
494+
if (skb->ip_summed == CHECKSUM_PARTIAL)
495+
status |= GRETH_TXBD_CSALL;
494496
status |= skb_headlen(skb) & GRETH_BD_LEN;
495497
if (greth->tx_next == GRETH_TXBD_NUM_MASK)
496498
status |= GRETH_BD_WR;
@@ -513,7 +515,9 @@ greth_start_xmit_gbit(struct sk_buff *skb, struct net_device *dev)
513515
greth->tx_skbuff[curr_tx] = NULL;
514516
bdp = greth->tx_bd_base + curr_tx;
515517

516-
status = GRETH_TXBD_CSALL | GRETH_BD_EN;
518+
status = GRETH_BD_EN;
519+
if (skb->ip_summed == CHECKSUM_PARTIAL)
520+
status |= GRETH_TXBD_CSALL;
517521
status |= frag->size & GRETH_BD_LEN;
518522

519523
/* Wrap around descriptor ring */
@@ -641,6 +645,7 @@ static void greth_clean_tx(struct net_device *dev)
641645
dev->stats.tx_fifo_errors++;
642646
}
643647
dev->stats.tx_packets++;
648+
dev->stats.tx_bytes += greth->tx_bufs_length[greth->tx_last];
644649
greth->tx_last = NEXT_TX(greth->tx_last);
645650
greth->tx_free++;
646651
}
@@ -695,6 +700,7 @@ static void greth_clean_tx_gbit(struct net_device *dev)
695700
greth->tx_skbuff[greth->tx_last] = NULL;
696701

697702
greth_update_tx_stats(dev, stat);
703+
dev->stats.tx_bytes += skb->len;
698704

699705
bdp = greth->tx_bd_base + greth->tx_last;
700706

@@ -796,6 +802,7 @@ static int greth_rx(struct net_device *dev, int limit)
796802
memcpy(skb_put(skb, pkt_len), phys_to_virt(dma_addr), pkt_len);
797803

798804
skb->protocol = eth_type_trans(skb, dev);
805+
dev->stats.rx_bytes += pkt_len;
799806
dev->stats.rx_packets++;
800807
netif_receive_skb(skb);
801808
}
@@ -910,6 +917,7 @@ static int greth_rx_gbit(struct net_device *dev, int limit)
910917

911918
skb->protocol = eth_type_trans(skb, dev);
912919
dev->stats.rx_packets++;
920+
dev->stats.rx_bytes += pkt_len;
913921
netif_receive_skb(skb);
914922

915923
greth->rx_skbuff[greth->rx_cur] = newskb;

drivers/net/greth.h

+1
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ struct greth_private {
103103

104104
unsigned char *tx_bufs[GRETH_TXBD_NUM];
105105
unsigned char *rx_bufs[GRETH_RXBD_NUM];
106+
u16 tx_bufs_length[GRETH_TXBD_NUM];
106107

107108
u16 tx_next;
108109
u16 tx_last;

drivers/net/ixgbe/ixgbe_main.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -1321,8 +1321,8 @@ static void ixgbe_clean_rx_irq(struct ixgbe_q_vector *q_vector,
13211321
if (ring_is_rsc_enabled(rx_ring))
13221322
pkt_is_rsc = ixgbe_get_rsc_state(rx_desc);
13231323

1324-
/* if this is a skb from previous receive DMA will be 0 */
1325-
if (rx_buffer_info->dma) {
1324+
/* linear means we are building an skb from multiple pages */
1325+
if (!skb_is_nonlinear(skb)) {
13261326
u16 hlen;
13271327
if (pkt_is_rsc &&
13281328
!(staterr & IXGBE_RXD_STAT_EOP) &&

drivers/net/netconsole.c

+7-1
Original file line numberDiff line numberDiff line change
@@ -799,5 +799,11 @@ static void __exit cleanup_netconsole(void)
799799
}
800800
}
801801

802-
module_init(init_netconsole);
802+
/*
803+
* Use late_initcall to ensure netconsole is
804+
* initialized after network device driver if built-in.
805+
*
806+
* late_initcall() and module_init() are identical if built as module.
807+
*/
808+
late_initcall(init_netconsole);
803809
module_exit(cleanup_netconsole);

drivers/net/ppp_generic.c

+6-1
Original file line numberDiff line numberDiff line change
@@ -1465,7 +1465,12 @@ static int ppp_mp_explode(struct ppp *ppp, struct sk_buff *skb)
14651465
continue;
14661466
}
14671467

1468-
mtu = pch->chan->mtu - hdrlen;
1468+
/*
1469+
* hdrlen includes the 2-byte PPP protocol field, but the
1470+
* MTU counts only the payload excluding the protocol field.
1471+
* (RFC1661 Section 2)
1472+
*/
1473+
mtu = pch->chan->mtu - (hdrlen - 2);
14691474
if (mtu < 4)
14701475
mtu = 4;
14711476
if (flen > mtu)

drivers/net/pxa168_eth.c

+1
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
#include <linux/clk.h>
4141
#include <linux/phy.h>
4242
#include <linux/io.h>
43+
#include <linux/interrupt.h>
4344
#include <linux/types.h>
4445
#include <asm/pgtable.h>
4546
#include <asm/system.h>

drivers/net/r8169.c

+27-5
Original file line numberDiff line numberDiff line change
@@ -407,6 +407,7 @@ enum rtl_register_content {
407407
RxOK = 0x0001,
408408

409409
/* RxStatusDesc */
410+
RxBOVF = (1 << 24),
410411
RxFOVF = (1 << 23),
411412
RxRWT = (1 << 22),
412413
RxRES = (1 << 21),
@@ -682,6 +683,7 @@ struct rtl8169_private {
682683
struct mii_if_info mii;
683684
struct rtl8169_counters counters;
684685
u32 saved_wolopts;
686+
u32 opts1_mask;
685687

686688
struct rtl_fw {
687689
const struct firmware *fw;
@@ -710,6 +712,7 @@ MODULE_FIRMWARE(FIRMWARE_8168D_1);
710712
MODULE_FIRMWARE(FIRMWARE_8168D_2);
711713
MODULE_FIRMWARE(FIRMWARE_8168E_1);
712714
MODULE_FIRMWARE(FIRMWARE_8168E_2);
715+
MODULE_FIRMWARE(FIRMWARE_8168E_3);
713716
MODULE_FIRMWARE(FIRMWARE_8105E_1);
714717

715718
static int rtl8169_open(struct net_device *dev);
@@ -3077,6 +3080,14 @@ static void rtl8169_phy_reset(struct net_device *dev,
30773080
netif_err(tp, link, dev, "PHY reset failed\n");
30783081
}
30793082

3083+
static bool rtl_tbi_enabled(struct rtl8169_private *tp)
3084+
{
3085+
void __iomem *ioaddr = tp->mmio_addr;
3086+
3087+
return (tp->mac_version == RTL_GIGA_MAC_VER_01) &&
3088+
(RTL_R8(PHYstatus) & TBI_Enable);
3089+
}
3090+
30803091
static void rtl8169_init_phy(struct net_device *dev, struct rtl8169_private *tp)
30813092
{
30823093
void __iomem *ioaddr = tp->mmio_addr;
@@ -3109,7 +3120,7 @@ static void rtl8169_init_phy(struct net_device *dev, struct rtl8169_private *tp)
31093120
ADVERTISED_1000baseT_Half |
31103121
ADVERTISED_1000baseT_Full : 0));
31113122

3112-
if (RTL_R8(PHYstatus) & TBI_Enable)
3123+
if (rtl_tbi_enabled(tp))
31133124
netif_info(tp, link, dev, "TBI auto-negotiating\n");
31143125
}
31153126

@@ -3319,9 +3330,16 @@ static void r810x_phy_power_up(struct rtl8169_private *tp)
33193330

33203331
static void r810x_pll_power_down(struct rtl8169_private *tp)
33213332
{
3333+
void __iomem *ioaddr = tp->mmio_addr;
3334+
33223335
if (__rtl8169_get_wol(tp) & WAKE_ANY) {
33233336
rtl_writephy(tp, 0x1f, 0x0000);
33243337
rtl_writephy(tp, MII_BMCR, 0x0000);
3338+
3339+
if (tp->mac_version == RTL_GIGA_MAC_VER_29 ||
3340+
tp->mac_version == RTL_GIGA_MAC_VER_30)
3341+
RTL_W32(RxConfig, RTL_R32(RxConfig) | AcceptBroadcast |
3342+
AcceptMulticast | AcceptMyPhys);
33253343
return;
33263344
}
33273345

@@ -3417,7 +3435,8 @@ static void r8168_pll_power_down(struct rtl8169_private *tp)
34173435
rtl_writephy(tp, MII_BMCR, 0x0000);
34183436

34193437
if (tp->mac_version == RTL_GIGA_MAC_VER_32 ||
3420-
tp->mac_version == RTL_GIGA_MAC_VER_33)
3438+
tp->mac_version == RTL_GIGA_MAC_VER_33 ||
3439+
tp->mac_version == RTL_GIGA_MAC_VER_34)
34213440
RTL_W32(RxConfig, RTL_R32(RxConfig) | AcceptBroadcast |
34223441
AcceptMulticast | AcceptMyPhys);
34233442
return;
@@ -3727,8 +3746,7 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
37273746
tp->features |= rtl_try_msi(pdev, ioaddr, cfg);
37283747
RTL_W8(Cfg9346, Cfg9346_Lock);
37293748

3730-
if ((tp->mac_version <= RTL_GIGA_MAC_VER_06) &&
3731-
(RTL_R8(PHYstatus) & TBI_Enable)) {
3749+
if (rtl_tbi_enabled(tp)) {
37323750
tp->set_speed = rtl8169_set_speed_tbi;
37333751
tp->get_settings = rtl8169_gset_tbi;
37343752
tp->phy_reset_enable = rtl8169_tbi_reset_enable;
@@ -3777,6 +3795,9 @@ rtl8169_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
37773795
tp->intr_event = cfg->intr_event;
37783796
tp->napi_event = cfg->napi_event;
37793797

3798+
tp->opts1_mask = (tp->mac_version != RTL_GIGA_MAC_VER_01) ?
3799+
~(RxBOVF | RxFOVF) : ~0;
3800+
37803801
init_timer(&tp->timer);
37813802
tp->timer.data = (unsigned long) dev;
37823803
tp->timer.function = rtl8169_phy_timer;
@@ -3988,6 +4009,7 @@ static void rtl8169_hw_reset(struct rtl8169_private *tp)
39884009
while (RTL_R8(TxPoll) & NPQ)
39894010
udelay(20);
39904011
} else if (tp->mac_version == RTL_GIGA_MAC_VER_34) {
4012+
RTL_W8(ChipCmd, RTL_R8(ChipCmd) | StopReq);
39914013
while (!(RTL_R32(TxConfig) & TXCFG_EMPTY))
39924014
udelay(100);
39934015
} else {
@@ -5314,7 +5336,7 @@ static int rtl8169_rx_interrupt(struct net_device *dev,
53145336
u32 status;
53155337

53165338
rmb();
5317-
status = le32_to_cpu(desc->opts1);
5339+
status = le32_to_cpu(desc->opts1) & tp->opts1_mask;
53185340

53195341
if (status & DescOwn)
53205342
break;

drivers/net/tg3.c

-2
Original file line numberDiff line numberDiff line change
@@ -6234,12 +6234,10 @@ static netdev_tx_t tg3_start_xmit(struct sk_buff *skb, struct net_device *dev)
62346234
}
62356235
}
62366236

6237-
#ifdef BCM_KERNEL_SUPPORTS_8021Q
62386237
if (vlan_tx_tag_present(skb)) {
62396238
base_flags |= TXD_FLAG_VLAN;
62406239
vlan = vlan_tx_tag_get(skb);
62416240
}
6242-
#endif
62436241

62446242
if (tg3_flag(tp, USE_JUMBO_BDFLAG) &&
62456243
!mss && skb->len > VLAN_ETH_FRAME_LEN)

drivers/net/wireless/b43/main.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -1632,7 +1632,8 @@ static void handle_irq_beacon(struct b43_wldev *dev)
16321632
u32 cmd, beacon0_valid, beacon1_valid;
16331633

16341634
if (!b43_is_mode(wl, NL80211_IFTYPE_AP) &&
1635-
!b43_is_mode(wl, NL80211_IFTYPE_MESH_POINT))
1635+
!b43_is_mode(wl, NL80211_IFTYPE_MESH_POINT) &&
1636+
!b43_is_mode(wl, NL80211_IFTYPE_ADHOC))
16361637
return;
16371638

16381639
/* This is the bottom half of the asynchronous beacon update. */

drivers/net/wireless/ipw2x00/ipw2100.c

+14-7
Original file line numberDiff line numberDiff line change
@@ -1901,17 +1901,19 @@ static void ipw2100_down(struct ipw2100_priv *priv)
19011901

19021902
/* Called by register_netdev() */
19031903
static int ipw2100_net_init(struct net_device *dev)
1904+
{
1905+
struct ipw2100_priv *priv = libipw_priv(dev);
1906+
1907+
return ipw2100_up(priv, 1);
1908+
}
1909+
1910+
static int ipw2100_wdev_init(struct net_device *dev)
19041911
{
19051912
struct ipw2100_priv *priv = libipw_priv(dev);
19061913
const struct libipw_geo *geo = libipw_get_geo(priv->ieee);
19071914
struct wireless_dev *wdev = &priv->ieee->wdev;
1908-
int ret;
19091915
int i;
19101916

1911-
ret = ipw2100_up(priv, 1);
1912-
if (ret)
1913-
return ret;
1914-
19151917
memcpy(wdev->wiphy->perm_addr, priv->mac_addr, ETH_ALEN);
19161918

19171919
/* fill-out priv->ieee->bg_band */
@@ -6350,9 +6352,13 @@ static int ipw2100_pci_init_one(struct pci_dev *pci_dev,
63506352
"Error calling register_netdev.\n");
63516353
goto fail;
63526354
}
6355+
registered = 1;
6356+
6357+
err = ipw2100_wdev_init(dev);
6358+
if (err)
6359+
goto fail;
63536360

63546361
mutex_lock(&priv->action_mutex);
6355-
registered = 1;
63566362

63576363
IPW_DEBUG_INFO("%s: Bound to %s\n", dev->name, pci_name(pci_dev));
63586364

@@ -6389,7 +6395,8 @@ static int ipw2100_pci_init_one(struct pci_dev *pci_dev,
63896395

63906396
fail_unlock:
63916397
mutex_unlock(&priv->action_mutex);
6392-
6398+
wiphy_unregister(priv->ieee->wdev.wiphy);
6399+
kfree(priv->ieee->bg_band.channels);
63936400
fail:
63946401
if (dev) {
63956402
if (registered)

0 commit comments

Comments
 (0)