diff options
51 files changed, 521 insertions, 180 deletions
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c index 471c7f3e8a4a..15853be4680a 100644 --- a/drivers/net/bnx2.c +++ b/drivers/net/bnx2.c | |||
@@ -56,8 +56,8 @@ | |||
56 | 56 | ||
57 | #define DRV_MODULE_NAME "bnx2" | 57 | #define DRV_MODULE_NAME "bnx2" |
58 | #define PFX DRV_MODULE_NAME ": " | 58 | #define PFX DRV_MODULE_NAME ": " |
59 | #define DRV_MODULE_VERSION "1.7.3" | 59 | #define DRV_MODULE_VERSION "1.7.4" |
60 | #define DRV_MODULE_RELDATE "January 29, 2008" | 60 | #define DRV_MODULE_RELDATE "February 18, 2008" |
61 | 61 | ||
62 | #define RUN_AT(x) (jiffies + (x)) | 62 | #define RUN_AT(x) (jiffies + (x)) |
63 | 63 | ||
@@ -1273,14 +1273,20 @@ bnx2_set_link(struct bnx2 *bp) | |||
1273 | 1273 | ||
1274 | if ((bp->phy_flags & BNX2_PHY_FLAG_SERDES) && | 1274 | if ((bp->phy_flags & BNX2_PHY_FLAG_SERDES) && |
1275 | (CHIP_NUM(bp) == CHIP_NUM_5706)) { | 1275 | (CHIP_NUM(bp) == CHIP_NUM_5706)) { |
1276 | u32 val; | 1276 | u32 val, an_dbg; |
1277 | 1277 | ||
1278 | if (bp->phy_flags & BNX2_PHY_FLAG_FORCED_DOWN) { | 1278 | if (bp->phy_flags & BNX2_PHY_FLAG_FORCED_DOWN) { |
1279 | bnx2_5706s_force_link_dn(bp, 0); | 1279 | bnx2_5706s_force_link_dn(bp, 0); |
1280 | bp->phy_flags &= ~BNX2_PHY_FLAG_FORCED_DOWN; | 1280 | bp->phy_flags &= ~BNX2_PHY_FLAG_FORCED_DOWN; |
1281 | } | 1281 | } |
1282 | val = REG_RD(bp, BNX2_EMAC_STATUS); | 1282 | val = REG_RD(bp, BNX2_EMAC_STATUS); |
1283 | if (val & BNX2_EMAC_STATUS_LINK) | 1283 | |
1284 | bnx2_write_phy(bp, MII_BNX2_MISC_SHADOW, MISC_SHDW_AN_DBG); | ||
1285 | bnx2_read_phy(bp, MII_BNX2_MISC_SHADOW, &an_dbg); | ||
1286 | bnx2_read_phy(bp, MII_BNX2_MISC_SHADOW, &an_dbg); | ||
1287 | |||
1288 | if ((val & BNX2_EMAC_STATUS_LINK) && | ||
1289 | !(an_dbg & MISC_SHDW_AN_DBG_NOSYNC)) | ||
1284 | bmsr |= BMSR_LSTATUS; | 1290 | bmsr |= BMSR_LSTATUS; |
1285 | else | 1291 | else |
1286 | bmsr &= ~BMSR_LSTATUS; | 1292 | bmsr &= ~BMSR_LSTATUS; |
@@ -5356,11 +5362,15 @@ bnx2_test_intr(struct bnx2 *bp) | |||
5356 | return -ENODEV; | 5362 | return -ENODEV; |
5357 | } | 5363 | } |
5358 | 5364 | ||
5365 | /* Determining link for parallel detection. */ | ||
5359 | static int | 5366 | static int |
5360 | bnx2_5706_serdes_has_link(struct bnx2 *bp) | 5367 | bnx2_5706_serdes_has_link(struct bnx2 *bp) |
5361 | { | 5368 | { |
5362 | u32 mode_ctl, an_dbg, exp; | 5369 | u32 mode_ctl, an_dbg, exp; |
5363 | 5370 | ||
5371 | if (bp->phy_flags & BNX2_PHY_FLAG_NO_PARALLEL) | ||
5372 | return 0; | ||
5373 | |||
5364 | bnx2_write_phy(bp, MII_BNX2_MISC_SHADOW, MISC_SHDW_MODE_CTL); | 5374 | bnx2_write_phy(bp, MII_BNX2_MISC_SHADOW, MISC_SHDW_MODE_CTL); |
5365 | bnx2_read_phy(bp, MII_BNX2_MISC_SHADOW, &mode_ctl); | 5375 | bnx2_read_phy(bp, MII_BNX2_MISC_SHADOW, &mode_ctl); |
5366 | 5376 | ||
@@ -5390,13 +5400,6 @@ bnx2_5706_serdes_timer(struct bnx2 *bp) | |||
5390 | int check_link = 1; | 5400 | int check_link = 1; |
5391 | 5401 | ||
5392 | spin_lock(&bp->phy_lock); | 5402 | spin_lock(&bp->phy_lock); |
5393 | if (bp->phy_flags & BNX2_PHY_FLAG_FORCED_DOWN) { | ||
5394 | bnx2_5706s_force_link_dn(bp, 0); | ||
5395 | bp->phy_flags &= ~BNX2_PHY_FLAG_FORCED_DOWN; | ||
5396 | spin_unlock(&bp->phy_lock); | ||
5397 | return; | ||
5398 | } | ||
5399 | |||
5400 | if (bp->serdes_an_pending) { | 5403 | if (bp->serdes_an_pending) { |
5401 | bp->serdes_an_pending--; | 5404 | bp->serdes_an_pending--; |
5402 | check_link = 0; | 5405 | check_link = 0; |
@@ -5420,7 +5423,6 @@ bnx2_5706_serdes_timer(struct bnx2 *bp) | |||
5420 | (bp->phy_flags & BNX2_PHY_FLAG_PARALLEL_DETECT)) { | 5423 | (bp->phy_flags & BNX2_PHY_FLAG_PARALLEL_DETECT)) { |
5421 | u32 phy2; | 5424 | u32 phy2; |
5422 | 5425 | ||
5423 | check_link = 0; | ||
5424 | bnx2_write_phy(bp, 0x17, 0x0f01); | 5426 | bnx2_write_phy(bp, 0x17, 0x0f01); |
5425 | bnx2_read_phy(bp, 0x15, &phy2); | 5427 | bnx2_read_phy(bp, 0x15, &phy2); |
5426 | if (phy2 & 0x20) { | 5428 | if (phy2 & 0x20) { |
@@ -5435,17 +5437,21 @@ bnx2_5706_serdes_timer(struct bnx2 *bp) | |||
5435 | } else | 5437 | } else |
5436 | bp->current_interval = bp->timer_interval; | 5438 | bp->current_interval = bp->timer_interval; |
5437 | 5439 | ||
5438 | if (bp->link_up && (bp->autoneg & AUTONEG_SPEED) && check_link) { | 5440 | if (check_link) { |
5439 | u32 val; | 5441 | u32 val; |
5440 | 5442 | ||
5441 | bnx2_write_phy(bp, MII_BNX2_MISC_SHADOW, MISC_SHDW_AN_DBG); | 5443 | bnx2_write_phy(bp, MII_BNX2_MISC_SHADOW, MISC_SHDW_AN_DBG); |
5442 | bnx2_read_phy(bp, MII_BNX2_MISC_SHADOW, &val); | 5444 | bnx2_read_phy(bp, MII_BNX2_MISC_SHADOW, &val); |
5443 | bnx2_read_phy(bp, MII_BNX2_MISC_SHADOW, &val); | 5445 | bnx2_read_phy(bp, MII_BNX2_MISC_SHADOW, &val); |
5444 | 5446 | ||
5445 | if (val & MISC_SHDW_AN_DBG_NOSYNC) { | 5447 | if (bp->link_up && (val & MISC_SHDW_AN_DBG_NOSYNC)) { |
5446 | bnx2_5706s_force_link_dn(bp, 1); | 5448 | if (!(bp->phy_flags & BNX2_PHY_FLAG_FORCED_DOWN)) { |
5447 | bp->phy_flags |= BNX2_PHY_FLAG_FORCED_DOWN; | 5449 | bnx2_5706s_force_link_dn(bp, 1); |
5448 | } | 5450 | bp->phy_flags |= BNX2_PHY_FLAG_FORCED_DOWN; |
5451 | } else | ||
5452 | bnx2_set_link(bp); | ||
5453 | } else if (!bp->link_up && !(val & MISC_SHDW_AN_DBG_NOSYNC)) | ||
5454 | bnx2_set_link(bp); | ||
5449 | } | 5455 | } |
5450 | spin_unlock(&bp->phy_lock); | 5456 | spin_unlock(&bp->phy_lock); |
5451 | } | 5457 | } |
@@ -7326,7 +7332,15 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev) | |||
7326 | bp->flags |= BNX2_FLAG_NO_WOL; | 7332 | bp->flags |= BNX2_FLAG_NO_WOL; |
7327 | bp->wol = 0; | 7333 | bp->wol = 0; |
7328 | } | 7334 | } |
7329 | if (CHIP_NUM(bp) != CHIP_NUM_5706) { | 7335 | if (CHIP_NUM(bp) == CHIP_NUM_5706) { |
7336 | /* Don't do parallel detect on this board because of | ||
7337 | * some board problems. The link will not go down | ||
7338 | * if we do parallel detect. | ||
7339 | */ | ||
7340 | if (pdev->subsystem_vendor == PCI_VENDOR_ID_HP && | ||
7341 | pdev->subsystem_device == 0x310c) | ||
7342 | bp->phy_flags |= BNX2_PHY_FLAG_NO_PARALLEL; | ||
7343 | } else { | ||
7330 | bp->phy_addr = 2; | 7344 | bp->phy_addr = 2; |
7331 | if (reg & BNX2_SHARED_HW_CFG_PHY_2_5G) | 7345 | if (reg & BNX2_SHARED_HW_CFG_PHY_2_5G) |
7332 | bp->phy_flags |= BNX2_PHY_FLAG_2_5G_CAPABLE; | 7346 | bp->phy_flags |= BNX2_PHY_FLAG_2_5G_CAPABLE; |
diff --git a/drivers/net/bnx2.h b/drivers/net/bnx2.h index 3aa0364942e2..1eaf5bb3d9c2 100644 --- a/drivers/net/bnx2.h +++ b/drivers/net/bnx2.h | |||
@@ -6673,6 +6673,7 @@ struct bnx2 { | |||
6673 | #define BNX2_PHY_FLAG_DIS_EARLY_DAC 0x00000400 | 6673 | #define BNX2_PHY_FLAG_DIS_EARLY_DAC 0x00000400 |
6674 | #define BNX2_PHY_FLAG_REMOTE_PHY_CAP 0x00000800 | 6674 | #define BNX2_PHY_FLAG_REMOTE_PHY_CAP 0x00000800 |
6675 | #define BNX2_PHY_FLAG_FORCED_DOWN 0x00001000 | 6675 | #define BNX2_PHY_FLAG_FORCED_DOWN 0x00001000 |
6676 | #define BNX2_PHY_FLAG_NO_PARALLEL 0x00002000 | ||
6676 | 6677 | ||
6677 | u32 mii_bmcr; | 6678 | u32 mii_bmcr; |
6678 | u32 mii_bmsr; | 6679 | u32 mii_bmsr; |
diff --git a/drivers/net/niu.c b/drivers/net/niu.c index e98ce1e4965b..d11ba61baa4f 100644 --- a/drivers/net/niu.c +++ b/drivers/net/niu.c | |||
@@ -1616,12 +1616,13 @@ static int niu_enable_alt_mac(struct niu *np, int index, int on) | |||
1616 | if (index >= niu_num_alt_addr(np)) | 1616 | if (index >= niu_num_alt_addr(np)) |
1617 | return -EINVAL; | 1617 | return -EINVAL; |
1618 | 1618 | ||
1619 | if (np->flags & NIU_FLAGS_XMAC) | 1619 | if (np->flags & NIU_FLAGS_XMAC) { |
1620 | reg = XMAC_ADDR_CMPEN; | 1620 | reg = XMAC_ADDR_CMPEN; |
1621 | else | 1621 | mask = 1 << index; |
1622 | } else { | ||
1622 | reg = BMAC_ADDR_CMPEN; | 1623 | reg = BMAC_ADDR_CMPEN; |
1623 | 1624 | mask = 1 << (index + 1); | |
1624 | mask = 1 << index; | 1625 | } |
1625 | 1626 | ||
1626 | val = nr64_mac(reg); | 1627 | val = nr64_mac(reg); |
1627 | if (on) | 1628 | if (on) |
diff --git a/drivers/net/niu.h b/drivers/net/niu.h index 0e8626adc573..59dc05fcd371 100644 --- a/drivers/net/niu.h +++ b/drivers/net/niu.h | |||
@@ -499,7 +499,7 @@ | |||
499 | #define BMAC_ADDR2 0x00110UL | 499 | #define BMAC_ADDR2 0x00110UL |
500 | #define BMAC_ADDR2_ADDR2 0x000000000000ffffULL | 500 | #define BMAC_ADDR2_ADDR2 0x000000000000ffffULL |
501 | 501 | ||
502 | #define BMAC_NUM_ALT_ADDR 7 | 502 | #define BMAC_NUM_ALT_ADDR 6 |
503 | 503 | ||
504 | #define BMAC_ALT_ADDR0(NUM) (0x00118UL + (NUM)*0x18UL) | 504 | #define BMAC_ALT_ADDR0(NUM) (0x00118UL + (NUM)*0x18UL) |
505 | #define BMAC_ALT_ADDR0_ADDR0 0x000000000000ffffULL | 505 | #define BMAC_ALT_ADDR0_ADDR0 0x000000000000ffffULL |
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index db606b603884..26ffb67f1da2 100644 --- a/drivers/net/tg3.c +++ b/drivers/net/tg3.c | |||
@@ -8781,7 +8781,7 @@ static int tg3_phys_id(struct net_device *dev, u32 data) | |||
8781 | return -EAGAIN; | 8781 | return -EAGAIN; |
8782 | 8782 | ||
8783 | if (data == 0) | 8783 | if (data == 0) |
8784 | data = 2; | 8784 | data = UINT_MAX / 2; |
8785 | 8785 | ||
8786 | for (i = 0; i < (data * 2); i++) { | 8786 | for (i = 0; i < (data * 2); i++) { |
8787 | if ((i % 2) == 0) | 8787 | if ((i % 2) == 0) |
diff --git a/drivers/net/veth.c b/drivers/net/veth.c index 3f67a29593bc..e2ad98bee6e7 100644 --- a/drivers/net/veth.c +++ b/drivers/net/veth.c | |||
@@ -244,18 +244,6 @@ static int veth_open(struct net_device *dev) | |||
244 | return 0; | 244 | return 0; |
245 | } | 245 | } |
246 | 246 | ||
247 | static int veth_close(struct net_device *dev) | ||
248 | { | ||
249 | struct veth_priv *priv; | ||
250 | |||
251 | if (netif_carrier_ok(dev)) { | ||
252 | priv = netdev_priv(dev); | ||
253 | netif_carrier_off(dev); | ||
254 | netif_carrier_off(priv->peer); | ||
255 | } | ||
256 | return 0; | ||
257 | } | ||
258 | |||
259 | static int veth_dev_init(struct net_device *dev) | 247 | static int veth_dev_init(struct net_device *dev) |
260 | { | 248 | { |
261 | struct veth_net_stats *stats; | 249 | struct veth_net_stats *stats; |
@@ -286,13 +274,50 @@ static void veth_setup(struct net_device *dev) | |||
286 | dev->hard_start_xmit = veth_xmit; | 274 | dev->hard_start_xmit = veth_xmit; |
287 | dev->get_stats = veth_get_stats; | 275 | dev->get_stats = veth_get_stats; |
288 | dev->open = veth_open; | 276 | dev->open = veth_open; |
289 | dev->stop = veth_close; | ||
290 | dev->ethtool_ops = &veth_ethtool_ops; | 277 | dev->ethtool_ops = &veth_ethtool_ops; |
291 | dev->features |= NETIF_F_LLTX; | 278 | dev->features |= NETIF_F_LLTX; |
292 | dev->init = veth_dev_init; | 279 | dev->init = veth_dev_init; |
293 | dev->destructor = veth_dev_free; | 280 | dev->destructor = veth_dev_free; |
294 | } | 281 | } |
295 | 282 | ||
283 | static void veth_change_state(struct net_device *dev) | ||
284 | { | ||
285 | struct net_device *peer; | ||
286 | struct veth_priv *priv; | ||
287 | |||
288 | priv = netdev_priv(dev); | ||
289 | peer = priv->peer; | ||
290 | |||
291 | if (netif_carrier_ok(peer)) { | ||
292 | if (!netif_carrier_ok(dev)) | ||
293 | netif_carrier_on(dev); | ||
294 | } else { | ||
295 | if (netif_carrier_ok(dev)) | ||
296 | netif_carrier_off(dev); | ||
297 | } | ||
298 | } | ||
299 | |||
300 | static int veth_device_event(struct notifier_block *unused, | ||
301 | unsigned long event, void *ptr) | ||
302 | { | ||
303 | struct net_device *dev = ptr; | ||
304 | |||
305 | if (dev->open != veth_open) | ||
306 | goto out; | ||
307 | |||
308 | switch (event) { | ||
309 | case NETDEV_CHANGE: | ||
310 | veth_change_state(dev); | ||
311 | break; | ||
312 | } | ||
313 | out: | ||
314 | return NOTIFY_DONE; | ||
315 | } | ||
316 | |||
317 | static struct notifier_block veth_notifier_block __read_mostly = { | ||
318 | .notifier_call = veth_device_event, | ||
319 | }; | ||
320 | |||
296 | /* | 321 | /* |
297 | * netlink interface | 322 | * netlink interface |
298 | */ | 323 | */ |
@@ -454,12 +479,14 @@ static struct rtnl_link_ops veth_link_ops = { | |||
454 | 479 | ||
455 | static __init int veth_init(void) | 480 | static __init int veth_init(void) |
456 | { | 481 | { |
482 | register_netdevice_notifier(&veth_notifier_block); | ||
457 | return rtnl_link_register(&veth_link_ops); | 483 | return rtnl_link_register(&veth_link_ops); |
458 | } | 484 | } |
459 | 485 | ||
460 | static __exit void veth_exit(void) | 486 | static __exit void veth_exit(void) |
461 | { | 487 | { |
462 | rtnl_link_unregister(&veth_link_ops); | 488 | rtnl_link_unregister(&veth_link_ops); |
489 | unregister_netdevice_notifier(&veth_notifier_block); | ||
463 | } | 490 | } |
464 | 491 | ||
465 | module_init(veth_init); | 492 | module_init(veth_init); |
diff --git a/drivers/net/wireless/ath5k/ath5k.h b/drivers/net/wireless/ath5k/ath5k.h index c79066b38d3b..69dea3392612 100644 --- a/drivers/net/wireless/ath5k/ath5k.h +++ b/drivers/net/wireless/ath5k/ath5k.h | |||
@@ -1035,7 +1035,7 @@ struct ath5k_hw { | |||
1035 | unsigned int, unsigned int, enum ath5k_pkt_type, unsigned int, | 1035 | unsigned int, unsigned int, enum ath5k_pkt_type, unsigned int, |
1036 | unsigned int, unsigned int, unsigned int, unsigned int, | 1036 | unsigned int, unsigned int, unsigned int, unsigned int, |
1037 | unsigned int, unsigned int, unsigned int); | 1037 | unsigned int, unsigned int, unsigned int); |
1038 | bool (*ah_setup_xtx_desc)(struct ath5k_hw *, struct ath5k_desc *, | 1038 | int (*ah_setup_xtx_desc)(struct ath5k_hw *, struct ath5k_desc *, |
1039 | unsigned int, unsigned int, unsigned int, unsigned int, | 1039 | unsigned int, unsigned int, unsigned int, unsigned int, |
1040 | unsigned int, unsigned int); | 1040 | unsigned int, unsigned int); |
1041 | int (*ah_proc_tx_desc)(struct ath5k_hw *, struct ath5k_desc *); | 1041 | int (*ah_proc_tx_desc)(struct ath5k_hw *, struct ath5k_desc *); |
diff --git a/drivers/net/wireless/ath5k/base.c b/drivers/net/wireless/ath5k/base.c index dfdaec020739..bef967ce34a6 100644 --- a/drivers/net/wireless/ath5k/base.c +++ b/drivers/net/wireless/ath5k/base.c | |||
@@ -668,7 +668,10 @@ ath5k_attach(struct pci_dev *pdev, struct ieee80211_hw *hw) | |||
668 | * return false w/o doing anything. MAC's that do | 668 | * return false w/o doing anything. MAC's that do |
669 | * support it will return true w/o doing anything. | 669 | * support it will return true w/o doing anything. |
670 | */ | 670 | */ |
671 | if (ah->ah_setup_xtx_desc(ah, NULL, 0, 0, 0, 0, 0, 0)) | 671 | ret = ah->ah_setup_xtx_desc(ah, NULL, 0, 0, 0, 0, 0, 0); |
672 | if (ret < 0) | ||
673 | goto err; | ||
674 | if (ret > 0) | ||
672 | __set_bit(ATH_STAT_MRRETRY, sc->status); | 675 | __set_bit(ATH_STAT_MRRETRY, sc->status); |
673 | 676 | ||
674 | /* | 677 | /* |
@@ -1715,6 +1718,7 @@ ath5k_tasklet_rx(unsigned long data) | |||
1715 | break; | 1718 | break; |
1716 | else if (unlikely(ret)) { | 1719 | else if (unlikely(ret)) { |
1717 | ATH5K_ERR(sc, "error in processing rx descriptor\n"); | 1720 | ATH5K_ERR(sc, "error in processing rx descriptor\n"); |
1721 | spin_unlock(&sc->rxbuflock); | ||
1718 | return; | 1722 | return; |
1719 | } | 1723 | } |
1720 | 1724 | ||
@@ -2126,8 +2130,9 @@ ath5k_beacon_update_timers(struct ath5k_softc *sc, u64 bc_tsf) | |||
2126 | "updated timers based on beacon TSF\n"); | 2130 | "updated timers based on beacon TSF\n"); |
2127 | 2131 | ||
2128 | ATH5K_DBG_UNLIMIT(sc, ATH5K_DEBUG_BEACON, | 2132 | ATH5K_DBG_UNLIMIT(sc, ATH5K_DEBUG_BEACON, |
2129 | "bc_tsf %llx hw_tsf %llx bc_tu %u hw_tu %u nexttbtt %u\n", | 2133 | "bc_tsf %llx hw_tsf %llx bc_tu %u hw_tu %u nexttbtt %u\n", |
2130 | bc_tsf, hw_tsf, bc_tu, hw_tu, nexttbtt); | 2134 | (unsigned long long) bc_tsf, |
2135 | (unsigned long long) hw_tsf, bc_tu, hw_tu, nexttbtt); | ||
2131 | ATH5K_DBG_UNLIMIT(sc, ATH5K_DEBUG_BEACON, "intval %u %s %s\n", | 2136 | ATH5K_DBG_UNLIMIT(sc, ATH5K_DEBUG_BEACON, "intval %u %s %s\n", |
2132 | intval & AR5K_BEACON_PERIOD, | 2137 | intval & AR5K_BEACON_PERIOD, |
2133 | intval & AR5K_BEACON_ENA ? "AR5K_BEACON_ENA" : "", | 2138 | intval & AR5K_BEACON_ENA ? "AR5K_BEACON_ENA" : "", |
@@ -2385,10 +2390,11 @@ ath5k_intr(int irq, void *dev_id) | |||
2385 | u64 tsf = ath5k_hw_get_tsf64(ah); | 2390 | u64 tsf = ath5k_hw_get_tsf64(ah); |
2386 | sc->nexttbtt += sc->bintval; | 2391 | sc->nexttbtt += sc->bintval; |
2387 | ATH5K_DBG(sc, ATH5K_DEBUG_BEACON, | 2392 | ATH5K_DBG(sc, ATH5K_DEBUG_BEACON, |
2388 | "SWBA nexttbtt: %x hw_tu: %x " | 2393 | "SWBA nexttbtt: %x hw_tu: %x " |
2389 | "TSF: %llx\n", | 2394 | "TSF: %llx\n", |
2390 | sc->nexttbtt, | 2395 | sc->nexttbtt, |
2391 | TSF_TO_TU(tsf), tsf); | 2396 | TSF_TO_TU(tsf), |
2397 | (unsigned long long) tsf); | ||
2392 | } else { | 2398 | } else { |
2393 | ath5k_beacon_send(sc); | 2399 | ath5k_beacon_send(sc); |
2394 | } | 2400 | } |
diff --git a/drivers/net/wireless/ath5k/hw.c b/drivers/net/wireless/ath5k/hw.c index 1ab57aa6e4dc..c2de2d958e8e 100644 --- a/drivers/net/wireless/ath5k/hw.c +++ b/drivers/net/wireless/ath5k/hw.c | |||
@@ -45,7 +45,7 @@ static int ath5k_hw_setup_4word_tx_desc(struct ath5k_hw *, struct ath5k_desc *, | |||
45 | unsigned int, unsigned int, enum ath5k_pkt_type, unsigned int, | 45 | unsigned int, unsigned int, enum ath5k_pkt_type, unsigned int, |
46 | unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, | 46 | unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, |
47 | unsigned int, unsigned int); | 47 | unsigned int, unsigned int); |
48 | static bool ath5k_hw_setup_xr_tx_desc(struct ath5k_hw *, struct ath5k_desc *, | 48 | static int ath5k_hw_setup_xr_tx_desc(struct ath5k_hw *, struct ath5k_desc *, |
49 | unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, | 49 | unsigned int, unsigned int, unsigned int, unsigned int, unsigned int, |
50 | unsigned int); | 50 | unsigned int); |
51 | static int ath5k_hw_proc_4word_tx_status(struct ath5k_hw *, struct ath5k_desc *); | 51 | static int ath5k_hw_proc_4word_tx_status(struct ath5k_hw *, struct ath5k_desc *); |
@@ -3743,7 +3743,7 @@ static int ath5k_hw_setup_4word_tx_desc(struct ath5k_hw *ah, | |||
3743 | /* | 3743 | /* |
3744 | * Initialize a 4-word multirate tx descriptor on 5212 | 3744 | * Initialize a 4-word multirate tx descriptor on 5212 |
3745 | */ | 3745 | */ |
3746 | static bool | 3746 | static int |
3747 | ath5k_hw_setup_xr_tx_desc(struct ath5k_hw *ah, struct ath5k_desc *desc, | 3747 | ath5k_hw_setup_xr_tx_desc(struct ath5k_hw *ah, struct ath5k_desc *desc, |
3748 | unsigned int tx_rate1, u_int tx_tries1, u_int tx_rate2, u_int tx_tries2, | 3748 | unsigned int tx_rate1, u_int tx_tries1, u_int tx_rate2, u_int tx_tries2, |
3749 | unsigned int tx_rate3, u_int tx_tries3) | 3749 | unsigned int tx_rate3, u_int tx_tries3) |
@@ -3783,10 +3783,10 @@ ath5k_hw_setup_xr_tx_desc(struct ath5k_hw *ah, struct ath5k_desc *desc, | |||
3783 | 3783 | ||
3784 | #undef _XTX_TRIES | 3784 | #undef _XTX_TRIES |
3785 | 3785 | ||
3786 | return true; | 3786 | return 1; |
3787 | } | 3787 | } |
3788 | 3788 | ||
3789 | return false; | 3789 | return 0; |
3790 | } | 3790 | } |
3791 | 3791 | ||
3792 | /* | 3792 | /* |
diff --git a/drivers/net/wireless/p54usb.c b/drivers/net/wireless/p54usb.c index 60d286eb0b8b..e7d4aee8799e 100644 --- a/drivers/net/wireless/p54usb.c +++ b/drivers/net/wireless/p54usb.c | |||
@@ -35,6 +35,7 @@ static struct usb_device_id p54u_table[] __devinitdata = { | |||
35 | {USB_DEVICE(0x0707, 0xee06)}, /* SMC 2862W-G */ | 35 | {USB_DEVICE(0x0707, 0xee06)}, /* SMC 2862W-G */ |
36 | {USB_DEVICE(0x083a, 0x4501)}, /* Accton 802.11g WN4501 USB */ | 36 | {USB_DEVICE(0x083a, 0x4501)}, /* Accton 802.11g WN4501 USB */ |
37 | {USB_DEVICE(0x083a, 0x4502)}, /* Siemens Gigaset USB Adapter */ | 37 | {USB_DEVICE(0x083a, 0x4502)}, /* Siemens Gigaset USB Adapter */ |
38 | {USB_DEVICE(0x083a, 0x5501)}, /* Phillips CPWUA054 */ | ||
38 | {USB_DEVICE(0x0846, 0x4200)}, /* Netgear WG121 */ | 39 | {USB_DEVICE(0x0846, 0x4200)}, /* Netgear WG121 */ |
39 | {USB_DEVICE(0x0846, 0x4210)}, /* Netgear WG121 the second ? */ | 40 | {USB_DEVICE(0x0846, 0x4210)}, /* Netgear WG121 the second ? */ |
40 | {USB_DEVICE(0x0846, 0x4220)}, /* Netgear WG111 */ | 41 | {USB_DEVICE(0x0846, 0x4220)}, /* Netgear WG111 */ |
@@ -62,6 +63,7 @@ static struct usb_device_id p54u_table[] __devinitdata = { | |||
62 | {USB_DEVICE(0x0cde, 0x0008)}, /* Sagem XG703A */ | 63 | {USB_DEVICE(0x0cde, 0x0008)}, /* Sagem XG703A */ |
63 | {USB_DEVICE(0x0d8e, 0x3762)}, /* DLink DWL-G120 Cohiba */ | 64 | {USB_DEVICE(0x0d8e, 0x3762)}, /* DLink DWL-G120 Cohiba */ |
64 | {USB_DEVICE(0x09aa, 0x1000)}, /* Spinnaker Proto board */ | 65 | {USB_DEVICE(0x09aa, 0x1000)}, /* Spinnaker Proto board */ |
66 | {USB_DEVICE(0x13b1, 0x000a)}, /* Linksys WUSB54G ver 2 */ | ||
65 | {USB_DEVICE(0x13B1, 0x000C)}, /* Linksys WUSB54AG */ | 67 | {USB_DEVICE(0x13B1, 0x000C)}, /* Linksys WUSB54AG */ |
66 | {USB_DEVICE(0x1435, 0x0427)}, /* Inventel UR054G */ | 68 | {USB_DEVICE(0x1435, 0x0427)}, /* Inventel UR054G */ |
67 | {USB_DEVICE(0x2001, 0x3704)}, /* DLink DWL-G122 rev A2 */ | 69 | {USB_DEVICE(0x2001, 0x3704)}, /* DLink DWL-G122 rev A2 */ |
diff --git a/drivers/net/wireless/rtl8180_dev.c b/drivers/net/wireless/rtl8180_dev.c index 27ebd689aa21..5e9a8ace0d81 100644 --- a/drivers/net/wireless/rtl8180_dev.c +++ b/drivers/net/wireless/rtl8180_dev.c | |||
@@ -135,13 +135,15 @@ static void rtl8180_handle_tx(struct ieee80211_hw *dev, unsigned int prio) | |||
135 | while (skb_queue_len(&ring->queue)) { | 135 | while (skb_queue_len(&ring->queue)) { |
136 | struct rtl8180_tx_desc *entry = &ring->desc[ring->idx]; | 136 | struct rtl8180_tx_desc *entry = &ring->desc[ring->idx]; |
137 | struct sk_buff *skb; | 137 | struct sk_buff *skb; |
138 | struct ieee80211_tx_status status = { {0} }; | 138 | struct ieee80211_tx_status status; |
139 | struct ieee80211_tx_control *control; | 139 | struct ieee80211_tx_control *control; |
140 | u32 flags = le32_to_cpu(entry->flags); | 140 | u32 flags = le32_to_cpu(entry->flags); |
141 | 141 | ||
142 | if (flags & RTL8180_TX_DESC_FLAG_OWN) | 142 | if (flags & RTL8180_TX_DESC_FLAG_OWN) |
143 | return; | 143 | return; |
144 | 144 | ||
145 | memset(&status, 0, sizeof(status)); | ||
146 | |||
145 | ring->idx = (ring->idx + 1) % ring->entries; | 147 | ring->idx = (ring->idx + 1) % ring->entries; |
146 | skb = __skb_dequeue(&ring->queue); | 148 | skb = __skb_dequeue(&ring->queue); |
147 | pci_unmap_single(priv->pdev, le32_to_cpu(entry->tx_buf), | 149 | pci_unmap_single(priv->pdev, le32_to_cpu(entry->tx_buf), |
diff --git a/drivers/net/wireless/rtl8187_dev.c b/drivers/net/wireless/rtl8187_dev.c index 0d71716d750d..f44505994a0e 100644 --- a/drivers/net/wireless/rtl8187_dev.c +++ b/drivers/net/wireless/rtl8187_dev.c | |||
@@ -113,10 +113,12 @@ void rtl8187_write_phy(struct ieee80211_hw *dev, u8 addr, u32 data) | |||
113 | 113 | ||
114 | static void rtl8187_tx_cb(struct urb *urb) | 114 | static void rtl8187_tx_cb(struct urb *urb) |
115 | { | 115 | { |
116 | struct ieee80211_tx_status status = { {0} }; | 116 | struct ieee80211_tx_status status; |
117 | struct sk_buff *skb = (struct sk_buff *)urb->context; | 117 | struct sk_buff *skb = (struct sk_buff *)urb->context; |
118 | struct rtl8187_tx_info *info = (struct rtl8187_tx_info *)skb->cb; | 118 | struct rtl8187_tx_info *info = (struct rtl8187_tx_info *)skb->cb; |
119 | 119 | ||
120 | memset(&status, 0, sizeof(status)); | ||
121 | |||
120 | usb_free_urb(info->urb); | 122 | usb_free_urb(info->urb); |
121 | if (info->control) | 123 | if (info->control) |
122 | memcpy(&status.control, info->control, sizeof(status.control)); | 124 | memcpy(&status.control, info->control, sizeof(status.control)); |
diff --git a/drivers/net/wireless/zd1211rw/zd_mac.c b/drivers/net/wireless/zd1211rw/zd_mac.c index 49127e4b42c2..76ef2d83919d 100644 --- a/drivers/net/wireless/zd1211rw/zd_mac.c +++ b/drivers/net/wireless/zd1211rw/zd_mac.c | |||
@@ -360,11 +360,14 @@ void zd_mac_tx_failed(struct ieee80211_hw *hw) | |||
360 | { | 360 | { |
361 | struct sk_buff_head *q = &zd_hw_mac(hw)->ack_wait_queue; | 361 | struct sk_buff_head *q = &zd_hw_mac(hw)->ack_wait_queue; |
362 | struct sk_buff *skb; | 362 | struct sk_buff *skb; |
363 | struct ieee80211_tx_status status = {{0}}; | 363 | struct ieee80211_tx_status status; |
364 | 364 | ||
365 | skb = skb_dequeue(q); | 365 | skb = skb_dequeue(q); |
366 | if (skb == NULL) | 366 | if (skb == NULL) |
367 | return; | 367 | return; |
368 | |||
369 | memset(&status, 0, sizeof(status)); | ||
370 | |||
368 | tx_status(hw, skb, &status, 0); | 371 | tx_status(hw, skb, &status, 0); |
369 | } | 372 | } |
370 | 373 | ||
@@ -389,7 +392,8 @@ void zd_mac_tx_to_dev(struct sk_buff *skb, int error) | |||
389 | if (unlikely(error || | 392 | if (unlikely(error || |
390 | (cb->control->flags & IEEE80211_TXCTL_NO_ACK))) | 393 | (cb->control->flags & IEEE80211_TXCTL_NO_ACK))) |
391 | { | 394 | { |
392 | struct ieee80211_tx_status status = {{0}}; | 395 | struct ieee80211_tx_status status; |
396 | memset(&status, 0, sizeof(status)); | ||
393 | tx_status(hw, skb, &status, !error); | 397 | tx_status(hw, skb, &status, !error); |
394 | } else { | 398 | } else { |
395 | struct sk_buff_head *q = | 399 | struct sk_buff_head *q = |
@@ -603,7 +607,9 @@ static int filter_ack(struct ieee80211_hw *hw, struct ieee80211_hdr *rx_hdr, | |||
603 | tx_hdr = (struct ieee80211_hdr *)skb->data; | 607 | tx_hdr = (struct ieee80211_hdr *)skb->data; |
604 | if (likely(!compare_ether_addr(tx_hdr->addr2, rx_hdr->addr1))) | 608 | if (likely(!compare_ether_addr(tx_hdr->addr2, rx_hdr->addr1))) |
605 | { | 609 | { |
606 | struct ieee80211_tx_status status = {{0}}; | 610 | struct ieee80211_tx_status status; |
611 | |||
612 | memset(&status, 0, sizeof(status)); | ||
607 | status.flags = IEEE80211_TX_STATUS_ACK; | 613 | status.flags = IEEE80211_TX_STATUS_ACK; |
608 | status.ack_signal = stats->ssi; | 614 | status.ack_signal = stats->ssi; |
609 | __skb_unlink(skb, q); | 615 | __skb_unlink(skb, q); |
diff --git a/drivers/ssb/Kconfig b/drivers/ssb/Kconfig index d976660cb7f0..78fd33125e02 100644 --- a/drivers/ssb/Kconfig +++ b/drivers/ssb/Kconfig | |||
@@ -105,6 +105,12 @@ config SSB_DRIVER_MIPS | |||
105 | 105 | ||
106 | If unsure, say N | 106 | If unsure, say N |
107 | 107 | ||
108 | # Assumption: We are on embedded, if we compile the MIPS core. | ||
109 | config SSB_EMBEDDED | ||
110 | bool | ||
111 | depends on SSB_DRIVER_MIPS | ||
112 | default y | ||
113 | |||
108 | config SSB_DRIVER_EXTIF | 114 | config SSB_DRIVER_EXTIF |
109 | bool "SSB Broadcom EXTIF core driver (EXPERIMENTAL)" | 115 | bool "SSB Broadcom EXTIF core driver (EXPERIMENTAL)" |
110 | depends on SSB_DRIVER_MIPS && EXPERIMENTAL | 116 | depends on SSB_DRIVER_MIPS && EXPERIMENTAL |
diff --git a/drivers/ssb/Makefile b/drivers/ssb/Makefile index 7be397595805..e235144add7c 100644 --- a/drivers/ssb/Makefile +++ b/drivers/ssb/Makefile | |||
@@ -1,5 +1,6 @@ | |||
1 | # core | 1 | # core |
2 | ssb-y += main.o scan.o | 2 | ssb-y += main.o scan.o |
3 | ssb-$(CONFIG_SSB_EMBEDDED) += embedded.o | ||
3 | 4 | ||
4 | # host support | 5 | # host support |
5 | ssb-$(CONFIG_SSB_PCIHOST) += pci.o pcihost_wrapper.o | 6 | ssb-$(CONFIG_SSB_PCIHOST) += pci.o pcihost_wrapper.o |
diff --git a/drivers/ssb/driver_chipcommon.c b/drivers/ssb/driver_chipcommon.c index 6fbf1c53b6f2..e586321a473a 100644 --- a/drivers/ssb/driver_chipcommon.c +++ b/drivers/ssb/driver_chipcommon.c | |||
@@ -39,12 +39,14 @@ static inline void chipco_write32(struct ssb_chipcommon *cc, | |||
39 | ssb_write32(cc->dev, offset, value); | 39 | ssb_write32(cc->dev, offset, value); |
40 | } | 40 | } |
41 | 41 | ||
42 | static inline void chipco_write32_masked(struct ssb_chipcommon *cc, u16 offset, | 42 | static inline u32 chipco_write32_masked(struct ssb_chipcommon *cc, u16 offset, |
43 | u32 mask, u32 value) | 43 | u32 mask, u32 value) |
44 | { | 44 | { |
45 | value &= mask; | 45 | value &= mask; |
46 | value |= chipco_read32(cc, offset) & ~mask; | 46 | value |= chipco_read32(cc, offset) & ~mask; |
47 | chipco_write32(cc, offset, value); | 47 | chipco_write32(cc, offset, value); |
48 | |||
49 | return value; | ||
48 | } | 50 | } |
49 | 51 | ||
50 | void ssb_chipco_set_clockmode(struct ssb_chipcommon *cc, | 52 | void ssb_chipco_set_clockmode(struct ssb_chipcommon *cc, |
@@ -356,14 +358,29 @@ u32 ssb_chipco_gpio_in(struct ssb_chipcommon *cc, u32 mask) | |||
356 | return chipco_read32(cc, SSB_CHIPCO_GPIOIN) & mask; | 358 | return chipco_read32(cc, SSB_CHIPCO_GPIOIN) & mask; |
357 | } | 359 | } |
358 | 360 | ||
359 | void ssb_chipco_gpio_out(struct ssb_chipcommon *cc, u32 mask, u32 value) | 361 | u32 ssb_chipco_gpio_out(struct ssb_chipcommon *cc, u32 mask, u32 value) |
362 | { | ||
363 | return chipco_write32_masked(cc, SSB_CHIPCO_GPIOOUT, mask, value); | ||
364 | } | ||
365 | |||
366 | u32 ssb_chipco_gpio_outen(struct ssb_chipcommon *cc, u32 mask, u32 value) | ||
367 | { | ||
368 | return chipco_write32_masked(cc, SSB_CHIPCO_GPIOOUTEN, mask, value); | ||
369 | } | ||
370 | |||
371 | u32 ssb_chipco_gpio_control(struct ssb_chipcommon *cc, u32 mask, u32 value) | ||
372 | { | ||
373 | return chipco_write32_masked(cc, SSB_CHIPCO_GPIOCTL, mask, value); | ||
374 | } | ||
375 | |||
376 | u32 ssb_chipco_gpio_intmask(struct ssb_chipcommon *cc, u32 mask, u32 value) | ||
360 | { | 377 | { |
361 | chipco_write32_masked(cc, SSB_CHIPCO_GPIOOUT, mask, value); | 378 | return chipco_write32_masked(cc, SSB_CHIPCO_GPIOIRQ, mask, value); |
362 | } | 379 | } |
363 | 380 | ||
364 | void ssb_chipco_gpio_outen(struct ssb_chipcommon *cc, u32 mask, u32 value) | 381 | u32 ssb_chipco_gpio_polarity(struct ssb_chipcommon *cc, u32 mask, u32 value) |
365 | { | 382 | { |
366 | chipco_write32_masked(cc, SSB_CHIPCO_GPIOOUTEN, mask, value); | 383 | return chipco_write32_masked(cc, SSB_CHIPCO_GPIOPOL, mask, value); |
367 | } | 384 | } |
368 | 385 | ||
369 | #ifdef CONFIG_SSB_SERIAL | 386 | #ifdef CONFIG_SSB_SERIAL |
@@ -376,6 +393,7 @@ int ssb_chipco_serial_init(struct ssb_chipcommon *cc, | |||
376 | unsigned int irq; | 393 | unsigned int irq; |
377 | u32 baud_base, div; | 394 | u32 baud_base, div; |
378 | u32 i, n; | 395 | u32 i, n; |
396 | unsigned int ccrev = cc->dev->id.revision; | ||
379 | 397 | ||
380 | plltype = (cc->capabilities & SSB_CHIPCO_CAP_PLLT); | 398 | plltype = (cc->capabilities & SSB_CHIPCO_CAP_PLLT); |
381 | irq = ssb_mips_irq(cc->dev); | 399 | irq = ssb_mips_irq(cc->dev); |
@@ -387,14 +405,39 @@ int ssb_chipco_serial_init(struct ssb_chipcommon *cc, | |||
387 | chipco_read32(cc, SSB_CHIPCO_CLOCK_M2)); | 405 | chipco_read32(cc, SSB_CHIPCO_CLOCK_M2)); |
388 | div = 1; | 406 | div = 1; |
389 | } else { | 407 | } else { |
390 | if (cc->dev->id.revision >= 11) { | 408 | if (ccrev == 20) { |
409 | /* BCM5354 uses constant 25MHz clock */ | ||
410 | baud_base = 25000000; | ||
411 | div = 48; | ||
412 | /* Set the override bit so we don't divide it */ | ||
413 | chipco_write32(cc, SSB_CHIPCO_CORECTL, | ||
414 | chipco_read32(cc, SSB_CHIPCO_CORECTL) | ||
415 | | SSB_CHIPCO_CORECTL_UARTCLK0); | ||
416 | } else if ((ccrev >= 11) && (ccrev != 15)) { | ||
391 | /* Fixed ALP clock */ | 417 | /* Fixed ALP clock */ |
392 | baud_base = 20000000; | 418 | baud_base = 20000000; |
419 | if (cc->capabilities & SSB_CHIPCO_CAP_PMU) { | ||
420 | /* FIXME: baud_base is different for devices with a PMU */ | ||
421 | SSB_WARN_ON(1); | ||
422 | } | ||
393 | div = 1; | 423 | div = 1; |
424 | if (ccrev >= 21) { | ||
425 | /* Turn off UART clock before switching clocksource. */ | ||
426 | chipco_write32(cc, SSB_CHIPCO_CORECTL, | ||
427 | chipco_read32(cc, SSB_CHIPCO_CORECTL) | ||
428 | & ~SSB_CHIPCO_CORECTL_UARTCLKEN); | ||
429 | } | ||
394 | /* Set the override bit so we don't divide it */ | 430 | /* Set the override bit so we don't divide it */ |
395 | chipco_write32(cc, SSB_CHIPCO_CORECTL, | 431 | chipco_write32(cc, SSB_CHIPCO_CORECTL, |
396 | SSB_CHIPCO_CORECTL_UARTCLK0); | 432 | chipco_read32(cc, SSB_CHIPCO_CORECTL) |
397 | } else if (cc->dev->id.revision >= 3) { | 433 | | SSB_CHIPCO_CORECTL_UARTCLK0); |
434 | if (ccrev >= 21) { | ||
435 | /* Re-enable the UART clock. */ | ||
436 | chipco_write32(cc, SSB_CHIPCO_CORECTL, | ||
437 | chipco_read32(cc, SSB_CHIPCO_CORECTL) | ||
438 | | SSB_CHIPCO_CORECTL_UARTCLKEN); | ||
439 | } | ||
440 | } else if (ccrev >= 3) { | ||
398 | /* Internal backplane clock */ | 441 | /* Internal backplane clock */ |
399 | baud_base = ssb_clockspeed(bus); | 442 | baud_base = ssb_clockspeed(bus); |
400 | div = chipco_read32(cc, SSB_CHIPCO_CLKDIV) | 443 | div = chipco_read32(cc, SSB_CHIPCO_CLKDIV) |
@@ -406,7 +449,7 @@ int ssb_chipco_serial_init(struct ssb_chipcommon *cc, | |||
406 | } | 449 | } |
407 | 450 | ||
408 | /* Clock source depends on strapping if UartClkOverride is unset */ | 451 | /* Clock source depends on strapping if UartClkOverride is unset */ |
409 | if ((cc->dev->id.revision > 0) && | 452 | if ((ccrev > 0) && |
410 | !(chipco_read32(cc, SSB_CHIPCO_CORECTL) & SSB_CHIPCO_CORECTL_UARTCLK0)) { | 453 | !(chipco_read32(cc, SSB_CHIPCO_CORECTL) & SSB_CHIPCO_CORECTL_UARTCLK0)) { |
411 | if ((cc->capabilities & SSB_CHIPCO_CAP_UARTCLK) == | 454 | if ((cc->capabilities & SSB_CHIPCO_CAP_UARTCLK) == |
412 | SSB_CHIPCO_CAP_UARTCLK_INT) { | 455 | SSB_CHIPCO_CAP_UARTCLK_INT) { |
@@ -428,7 +471,7 @@ int ssb_chipco_serial_init(struct ssb_chipcommon *cc, | |||
428 | cc_mmio = cc->dev->bus->mmio + (cc->dev->core_index * SSB_CORE_SIZE); | 471 | cc_mmio = cc->dev->bus->mmio + (cc->dev->core_index * SSB_CORE_SIZE); |
429 | uart_regs = cc_mmio + SSB_CHIPCO_UART0_DATA; | 472 | uart_regs = cc_mmio + SSB_CHIPCO_UART0_DATA; |
430 | /* Offset changed at after rev 0 */ | 473 | /* Offset changed at after rev 0 */ |
431 | if (cc->dev->id.revision == 0) | 474 | if (ccrev == 0) |
432 | uart_regs += (i * 8); | 475 | uart_regs += (i * 8); |
433 | else | 476 | else |
434 | uart_regs += (i * 256); | 477 | uart_regs += (i * 256); |
diff --git a/drivers/ssb/driver_extif.c b/drivers/ssb/driver_extif.c index fe55eb8b038a..c3e1d3e6d610 100644 --- a/drivers/ssb/driver_extif.c +++ b/drivers/ssb/driver_extif.c | |||
@@ -27,12 +27,14 @@ static inline void extif_write32(struct ssb_extif *extif, u16 offset, u32 value) | |||
27 | ssb_write32(extif->dev, offset, value); | 27 | ssb_write32(extif->dev, offset, value); |
28 | } | 28 | } |
29 | 29 | ||
30 | static inline void extif_write32_masked(struct ssb_extif *extif, u16 offset, | 30 | static inline u32 extif_write32_masked(struct ssb_extif *extif, u16 offset, |
31 | u32 mask, u32 value) | 31 | u32 mask, u32 value) |
32 | { | 32 | { |
33 | value &= mask; | 33 | value &= mask; |
34 | value |= extif_read32(extif, offset) & ~mask; | 34 | value |= extif_read32(extif, offset) & ~mask; |
35 | extif_write32(extif, offset, value); | 35 | extif_write32(extif, offset, value); |
36 | |||
37 | return value; | ||
36 | } | 38 | } |
37 | 39 | ||
38 | #ifdef CONFIG_SSB_SERIAL | 40 | #ifdef CONFIG_SSB_SERIAL |
@@ -110,20 +112,35 @@ void ssb_extif_get_clockcontrol(struct ssb_extif *extif, | |||
110 | *m = extif_read32(extif, SSB_EXTIF_CLOCK_SB); | 112 | *m = extif_read32(extif, SSB_EXTIF_CLOCK_SB); |
111 | } | 113 | } |
112 | 114 | ||
115 | void ssb_extif_watchdog_timer_set(struct ssb_extif *extif, | ||
116 | u32 ticks) | ||
117 | { | ||
118 | extif_write32(extif, SSB_EXTIF_WATCHDOG, ticks); | ||
119 | } | ||
120 | |||
113 | u32 ssb_extif_gpio_in(struct ssb_extif *extif, u32 mask) | 121 | u32 ssb_extif_gpio_in(struct ssb_extif *extif, u32 mask) |
114 | { | 122 | { |
115 | return extif_read32(extif, SSB_EXTIF_GPIO_IN) & mask; | 123 | return extif_read32(extif, SSB_EXTIF_GPIO_IN) & mask; |
116 | } | 124 | } |
117 | 125 | ||
118 | void ssb_extif_gpio_out(struct ssb_extif *extif, u32 mask, u32 value) | 126 | u32 ssb_extif_gpio_out(struct ssb_extif *extif, u32 mask, u32 value) |
119 | { | 127 | { |
120 | return extif_write32_masked(extif, SSB_EXTIF_GPIO_OUT(0), | 128 | return extif_write32_masked(extif, SSB_EXTIF_GPIO_OUT(0), |
121 | mask, value); | 129 | mask, value); |
122 | } | 130 | } |
123 | 131 | ||
124 | void ssb_extif_gpio_outen(struct ssb_extif *extif, u32 mask, u32 value) | 132 | u32 ssb_extif_gpio_outen(struct ssb_extif *extif, u32 mask, u32 value) |
125 | { | 133 | { |
126 | return extif_write32_masked(extif, SSB_EXTIF_GPIO_OUTEN(0), | 134 | return extif_write32_masked(extif, SSB_EXTIF_GPIO_OUTEN(0), |
127 | mask, value); | 135 | mask, value); |
128 | } | 136 | } |
129 | 137 | ||
138 | u32 ssb_extif_gpio_polarity(struct ssb_extif *extif, u32 mask, u32 value) | ||
139 | { | ||
140 | return extif_write32_masked(extif, SSB_EXTIF_GPIO_INTPOL, mask, value); | ||
141 | } | ||
142 | |||
143 | u32 ssb_extif_gpio_intmask(struct ssb_extif *extif, u32 mask, u32 value) | ||
144 | { | ||
145 | return extif_write32_masked(extif, SSB_EXTIF_GPIO_INTMASK, mask, value); | ||
146 | } | ||
diff --git a/drivers/ssb/driver_pcicore.c b/drivers/ssb/driver_pcicore.c index 2faaa906d5d6..6d99a9880055 100644 --- a/drivers/ssb/driver_pcicore.c +++ b/drivers/ssb/driver_pcicore.c | |||
@@ -11,6 +11,7 @@ | |||
11 | #include <linux/ssb/ssb.h> | 11 | #include <linux/ssb/ssb.h> |
12 | #include <linux/pci.h> | 12 | #include <linux/pci.h> |
13 | #include <linux/delay.h> | 13 | #include <linux/delay.h> |
14 | #include <linux/ssb/ssb_embedded.h> | ||
14 | 15 | ||
15 | #include "ssb_private.h" | 16 | #include "ssb_private.h" |
16 | 17 | ||
@@ -27,6 +28,18 @@ void pcicore_write32(struct ssb_pcicore *pc, u16 offset, u32 value) | |||
27 | ssb_write32(pc->dev, offset, value); | 28 | ssb_write32(pc->dev, offset, value); |
28 | } | 29 | } |
29 | 30 | ||
31 | static inline | ||
32 | u16 pcicore_read16(struct ssb_pcicore *pc, u16 offset) | ||
33 | { | ||
34 | return ssb_read16(pc->dev, offset); | ||
35 | } | ||
36 | |||
37 | static inline | ||
38 | void pcicore_write16(struct ssb_pcicore *pc, u16 offset, u16 value) | ||
39 | { | ||
40 | ssb_write16(pc->dev, offset, value); | ||
41 | } | ||
42 | |||
30 | /************************************************** | 43 | /************************************************** |
31 | * Code for hostmode operation. | 44 | * Code for hostmode operation. |
32 | **************************************************/ | 45 | **************************************************/ |
@@ -66,6 +79,7 @@ int pcibios_plat_dev_init(struct pci_dev *d) | |||
66 | base = &ssb_pcicore_pcibus_iobase; | 79 | base = &ssb_pcicore_pcibus_iobase; |
67 | else | 80 | else |
68 | base = &ssb_pcicore_pcibus_membase; | 81 | base = &ssb_pcicore_pcibus_membase; |
82 | res->flags |= IORESOURCE_PCI_FIXED; | ||
69 | if (res->end) { | 83 | if (res->end) { |
70 | size = res->end - res->start + 1; | 84 | size = res->end - res->start + 1; |
71 | if (*base & (size - 1)) | 85 | if (*base & (size - 1)) |
@@ -88,10 +102,12 @@ int pcibios_plat_dev_init(struct pci_dev *d) | |||
88 | 102 | ||
89 | static void __init ssb_fixup_pcibridge(struct pci_dev *dev) | 103 | static void __init ssb_fixup_pcibridge(struct pci_dev *dev) |
90 | { | 104 | { |
105 | u8 lat; | ||
106 | |||
91 | if (dev->bus->number != 0 || PCI_SLOT(dev->devfn) != 0) | 107 | if (dev->bus->number != 0 || PCI_SLOT(dev->devfn) != 0) |
92 | return; | 108 | return; |
93 | 109 | ||
94 | ssb_printk(KERN_INFO "PCI: fixing up bridge\n"); | 110 | ssb_printk(KERN_INFO "PCI: Fixing up bridge %s\n", pci_name(dev)); |
95 | 111 | ||
96 | /* Enable PCI bridge bus mastering and memory space */ | 112 | /* Enable PCI bridge bus mastering and memory space */ |
97 | pci_set_master(dev); | 113 | pci_set_master(dev); |
@@ -101,7 +117,10 @@ static void __init ssb_fixup_pcibridge(struct pci_dev *dev) | |||
101 | pci_write_config_dword(dev, SSB_BAR1_CONTROL, 3); | 117 | pci_write_config_dword(dev, SSB_BAR1_CONTROL, 3); |
102 | 118 | ||
103 | /* Make sure our latency is high enough to handle the devices behind us */ | 119 | /* Make sure our latency is high enough to handle the devices behind us */ |
104 | pci_write_config_byte(dev, PCI_LATENCY_TIMER, 0xa8); | 120 | lat = 168; |
121 | ssb_printk(KERN_INFO "PCI: Fixing latency timer of device %s to %u\n", | ||
122 | pci_name(dev), lat); | ||
123 | pci_write_config_byte(dev, PCI_LATENCY_TIMER, lat); | ||
105 | } | 124 | } |
106 | DECLARE_PCI_FIXUP_EARLY(PCI_ANY_ID, PCI_ANY_ID, ssb_fixup_pcibridge); | 125 | DECLARE_PCI_FIXUP_EARLY(PCI_ANY_ID, PCI_ANY_ID, ssb_fixup_pcibridge); |
107 | 126 | ||
@@ -117,8 +136,10 @@ static u32 get_cfgspace_addr(struct ssb_pcicore *pc, | |||
117 | u32 addr = 0; | 136 | u32 addr = 0; |
118 | u32 tmp; | 137 | u32 tmp; |
119 | 138 | ||
120 | if (unlikely(pc->cardbusmode && dev > 1)) | 139 | /* We do only have one cardbus device behind the bridge. */ |
140 | if (pc->cardbusmode && (dev >= 1)) | ||
121 | goto out; | 141 | goto out; |
142 | |||
122 | if (bus == 0) { | 143 | if (bus == 0) { |
123 | /* Type 0 transaction */ | 144 | /* Type 0 transaction */ |
124 | if (unlikely(dev >= SSB_PCI_SLOT_MAX)) | 145 | if (unlikely(dev >= SSB_PCI_SLOT_MAX)) |
@@ -279,14 +300,14 @@ static struct resource ssb_pcicore_mem_resource = { | |||
279 | .name = "SSB PCIcore external memory", | 300 | .name = "SSB PCIcore external memory", |
280 | .start = SSB_PCI_DMA, | 301 | .start = SSB_PCI_DMA, |
281 | .end = SSB_PCI_DMA + SSB_PCI_DMA_SZ - 1, | 302 | .end = SSB_PCI_DMA + SSB_PCI_DMA_SZ - 1, |
282 | .flags = IORESOURCE_MEM, | 303 | .flags = IORESOURCE_MEM | IORESOURCE_PCI_FIXED, |
283 | }; | 304 | }; |
284 | 305 | ||
285 | static struct resource ssb_pcicore_io_resource = { | 306 | static struct resource ssb_pcicore_io_resource = { |
286 | .name = "SSB PCIcore external I/O", | 307 | .name = "SSB PCIcore external I/O", |
287 | .start = 0x100, | 308 | .start = 0x100, |
288 | .end = 0x7FF, | 309 | .end = 0x7FF, |
289 | .flags = IORESOURCE_IO, | 310 | .flags = IORESOURCE_IO | IORESOURCE_PCI_FIXED, |
290 | }; | 311 | }; |
291 | 312 | ||
292 | static struct pci_controller ssb_pcicore_controller = { | 313 | static struct pci_controller ssb_pcicore_controller = { |
@@ -318,7 +339,16 @@ static void ssb_pcicore_init_hostmode(struct ssb_pcicore *pc) | |||
318 | pcicore_write32(pc, SSB_PCICORE_ARBCTL, val); | 339 | pcicore_write32(pc, SSB_PCICORE_ARBCTL, val); |
319 | udelay(1); /* Assertion time demanded by the PCI standard */ | 340 | udelay(1); /* Assertion time demanded by the PCI standard */ |
320 | 341 | ||
321 | /*TODO cardbus mode */ | 342 | if (pc->dev->bus->has_cardbus_slot) { |
343 | ssb_dprintk(KERN_INFO PFX "CardBus slot detected\n"); | ||
344 | pc->cardbusmode = 1; | ||
345 | /* GPIO 1 resets the bridge */ | ||
346 | ssb_gpio_out(pc->dev->bus, 1, 1); | ||
347 | ssb_gpio_outen(pc->dev->bus, 1, 1); | ||
348 | pcicore_write16(pc, SSB_PCICORE_SPROM(0), | ||
349 | pcicore_read16(pc, SSB_PCICORE_SPROM(0)) | ||
350 | | 0x0400); | ||
351 | } | ||
322 | 352 | ||
323 | /* 64MB I/O window */ | 353 | /* 64MB I/O window */ |
324 | pcicore_write32(pc, SSB_PCICORE_SBTOPCI0, | 354 | pcicore_write32(pc, SSB_PCICORE_SBTOPCI0, |
@@ -344,7 +374,8 @@ static void ssb_pcicore_init_hostmode(struct ssb_pcicore *pc) | |||
344 | /* Ok, ready to run, register it to the system. | 374 | /* Ok, ready to run, register it to the system. |
345 | * The following needs change, if we want to port hostmode | 375 | * The following needs change, if we want to port hostmode |
346 | * to non-MIPS platform. */ | 376 | * to non-MIPS platform. */ |
347 | set_io_port_base((unsigned long)ioremap_nocache(SSB_PCI_MEM, 0x04000000)); | 377 | ssb_pcicore_controller.io_map_base = (unsigned long)ioremap_nocache(SSB_PCI_MEM, 0x04000000); |
378 | set_io_port_base(ssb_pcicore_controller.io_map_base); | ||
348 | /* Give some time to the PCI controller to configure itself with the new | 379 | /* Give some time to the PCI controller to configure itself with the new |
349 | * values. Not waiting at this point causes crashes of the machine. */ | 380 | * values. Not waiting at this point causes crashes of the machine. */ |
350 | mdelay(10); | 381 | mdelay(10); |
diff --git a/drivers/ssb/embedded.c b/drivers/ssb/embedded.c new file mode 100644 index 000000000000..d3ade821555c --- /dev/null +++ b/drivers/ssb/embedded.c | |||
@@ -0,0 +1,132 @@ | |||
1 | /* | ||
2 | * Sonics Silicon Backplane | ||
3 | * Embedded systems support code | ||
4 | * | ||
5 | * Copyright 2005-2008, Broadcom Corporation | ||
6 | * Copyright 2006-2008, Michael Buesch <mb@bu3sch.de> | ||
7 | * | ||
8 | * Licensed under the GNU/GPL. See COPYING for details. | ||
9 | */ | ||
10 | |||
11 | #include <linux/ssb/ssb.h> | ||
12 | #include <linux/ssb/ssb_embedded.h> | ||
13 | |||
14 | #include "ssb_private.h" | ||
15 | |||
16 | |||
17 | int ssb_watchdog_timer_set(struct ssb_bus *bus, u32 ticks) | ||
18 | { | ||
19 | if (ssb_chipco_available(&bus->chipco)) { | ||
20 | ssb_chipco_watchdog_timer_set(&bus->chipco, ticks); | ||
21 | return 0; | ||
22 | } | ||
23 | if (ssb_extif_available(&bus->extif)) { | ||
24 | ssb_extif_watchdog_timer_set(&bus->extif, ticks); | ||
25 | return 0; | ||
26 | } | ||
27 | return -ENODEV; | ||
28 | } | ||
29 | |||
30 | u32 ssb_gpio_in(struct ssb_bus *bus, u32 mask) | ||
31 | { | ||
32 | unsigned long flags; | ||
33 | u32 res = 0; | ||
34 | |||
35 | spin_lock_irqsave(&bus->gpio_lock, flags); | ||
36 | if (ssb_chipco_available(&bus->chipco)) | ||
37 | res = ssb_chipco_gpio_in(&bus->chipco, mask); | ||
38 | else if (ssb_extif_available(&bus->extif)) | ||
39 | res = ssb_extif_gpio_in(&bus->extif, mask); | ||
40 | else | ||
41 | SSB_WARN_ON(1); | ||
42 | spin_unlock_irqrestore(&bus->gpio_lock, flags); | ||
43 | |||
44 | return res; | ||
45 | } | ||
46 | EXPORT_SYMBOL(ssb_gpio_in); | ||
47 | |||
48 | u32 ssb_gpio_out(struct ssb_bus *bus, u32 mask, u32 value) | ||
49 | { | ||
50 | unsigned long flags; | ||
51 | u32 res = 0; | ||
52 | |||
53 | spin_lock_irqsave(&bus->gpio_lock, flags); | ||
54 | if (ssb_chipco_available(&bus->chipco)) | ||
55 | res = ssb_chipco_gpio_out(&bus->chipco, mask, value); | ||
56 | else if (ssb_extif_available(&bus->extif)) | ||
57 | res = ssb_extif_gpio_out(&bus->extif, mask, value); | ||
58 | else | ||
59 | SSB_WARN_ON(1); | ||
60 | spin_unlock_irqrestore(&bus->gpio_lock, flags); | ||
61 | |||
62 | return res; | ||
63 | } | ||
64 | EXPORT_SYMBOL(ssb_gpio_out); | ||
65 | |||
66 | u32 ssb_gpio_outen(struct ssb_bus *bus, u32 mask, u32 value) | ||
67 | { | ||
68 | unsigned long flags; | ||
69 | u32 res = 0; | ||
70 | |||
71 | spin_lock_irqsave(&bus->gpio_lock, flags); | ||
72 | if (ssb_chipco_available(&bus->chipco)) | ||
73 | res = ssb_chipco_gpio_outen(&bus->chipco, mask, value); | ||
74 | else if (ssb_extif_available(&bus->extif)) | ||
75 | res = ssb_extif_gpio_outen(&bus->extif, mask, value); | ||
76 | else | ||
77 | SSB_WARN_ON(1); | ||
78 | spin_unlock_irqrestore(&bus->gpio_lock, flags); | ||
79 | |||
80 | return res; | ||
81 | } | ||
82 | EXPORT_SYMBOL(ssb_gpio_outen); | ||
83 | |||
84 | u32 ssb_gpio_control(struct ssb_bus *bus, u32 mask, u32 value) | ||
85 | { | ||
86 | unsigned long flags; | ||
87 | u32 res = 0; | ||
88 | |||
89 | spin_lock_irqsave(&bus->gpio_lock, flags); | ||
90 | if (ssb_chipco_available(&bus->chipco)) | ||
91 | res = ssb_chipco_gpio_control(&bus->chipco, mask, value); | ||
92 | spin_unlock_irqrestore(&bus->gpio_lock, flags); | ||
93 | |||
94 | return res; | ||
95 | } | ||
96 | EXPORT_SYMBOL(ssb_gpio_control); | ||
97 | |||
98 | u32 ssb_gpio_intmask(struct ssb_bus *bus, u32 mask, u32 value) | ||
99 | { | ||
100 | unsigned long flags; | ||
101 | u32 res = 0; | ||
102 | |||
103 | spin_lock_irqsave(&bus->gpio_lock, flags); | ||
104 | if (ssb_chipco_available(&bus->chipco)) | ||
105 | res = ssb_chipco_gpio_intmask(&bus->chipco, mask, value); | ||
106 | else if (ssb_extif_available(&bus->extif)) | ||
107 | res = ssb_extif_gpio_intmask(&bus->extif, mask, value); | ||
108 | else | ||
109 | SSB_WARN_ON(1); | ||
110 | spin_unlock_irqrestore(&bus->gpio_lock, flags); | ||
111 | |||
112 | return res; | ||
113 | } | ||
114 | EXPORT_SYMBOL(ssb_gpio_intmask); | ||
115 | |||
116 | u32 ssb_gpio_polarity(struct ssb_bus *bus, u32 mask, u32 value) | ||
117 | { | ||
118 | unsigned long flags; | ||
119 | u32 res = 0; | ||
120 | |||
121 | spin_lock_irqsave(&bus->gpio_lock, flags); | ||
122 | if (ssb_chipco_available(&bus->chipco)) | ||
123 | res = ssb_chipco_gpio_polarity(&bus->chipco, mask, value); | ||
124 | else if (ssb_extif_available(&bus->extif)) | ||
125 | res = ssb_extif_gpio_polarity(&bus->extif, mask, value); | ||
126 | else | ||
127 | SSB_WARN_ON(1); | ||
128 | spin_unlock_irqrestore(&bus->gpio_lock, flags); | ||
129 | |||
130 | return res; | ||
131 | } | ||
132 | EXPORT_SYMBOL(ssb_gpio_polarity); | ||
diff --git a/drivers/ssb/main.c b/drivers/ssb/main.c index 9028ed5715a1..bedb2b4ee9d2 100644 --- a/drivers/ssb/main.c +++ b/drivers/ssb/main.c | |||
@@ -557,6 +557,7 @@ static int ssb_fetch_invariants(struct ssb_bus *bus, | |||
557 | goto out; | 557 | goto out; |
558 | memcpy(&bus->boardinfo, &iv.boardinfo, sizeof(iv.boardinfo)); | 558 | memcpy(&bus->boardinfo, &iv.boardinfo, sizeof(iv.boardinfo)); |
559 | memcpy(&bus->sprom, &iv.sprom, sizeof(iv.sprom)); | 559 | memcpy(&bus->sprom, &iv.sprom, sizeof(iv.sprom)); |
560 | bus->has_cardbus_slot = iv.has_cardbus_slot; | ||
560 | out: | 561 | out: |
561 | return err; | 562 | return err; |
562 | } | 563 | } |
@@ -569,6 +570,9 @@ static int ssb_bus_register(struct ssb_bus *bus, | |||
569 | 570 | ||
570 | spin_lock_init(&bus->bar_lock); | 571 | spin_lock_init(&bus->bar_lock); |
571 | INIT_LIST_HEAD(&bus->list); | 572 | INIT_LIST_HEAD(&bus->list); |
573 | #ifdef CONFIG_SSB_EMBEDDED | ||
574 | spin_lock_init(&bus->gpio_lock); | ||
575 | #endif | ||
572 | 576 | ||
573 | /* Powerup the bus */ | 577 | /* Powerup the bus */ |
574 | err = ssb_pci_xtal(bus, SSB_GPIO_XTAL | SSB_GPIO_PLL, 1); | 578 | err = ssb_pci_xtal(bus, SSB_GPIO_XTAL | SSB_GPIO_PLL, 1); |
diff --git a/include/linux/if_ether.h b/include/linux/if_ether.h index 42dc6a3571ec..e157c1399b61 100644 --- a/include/linux/if_ether.h +++ b/include/linux/if_ether.h | |||
@@ -129,7 +129,8 @@ extern ssize_t sysfs_format_mac(char *buf, const unsigned char *addr, int len); | |||
129 | /* | 129 | /* |
130 | * Display a 6 byte device address (MAC) in a readable format. | 130 | * Display a 6 byte device address (MAC) in a readable format. |
131 | */ | 131 | */ |
132 | extern __pure char *print_mac(char *buf, const unsigned char *addr); | 132 | extern char *print_mac(char *buf, const unsigned char *addr); |
133 | #define MAC_FMT "%02x:%02x:%02x:%02x:%02x:%02x" | ||
133 | #define MAC_BUF_SIZE 18 | 134 | #define MAC_BUF_SIZE 18 |
134 | #define DECLARE_MAC_BUF(var) char var[MAC_BUF_SIZE] __maybe_unused | 135 | #define DECLARE_MAC_BUF(var) char var[MAC_BUF_SIZE] __maybe_unused |
135 | 136 | ||
diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h index d74e79bacd2d..b74b615492e8 100644 --- a/include/linux/netfilter.h +++ b/include/linux/netfilter.h | |||
@@ -51,7 +51,7 @@ enum nf_inet_hooks { | |||
51 | }; | 51 | }; |
52 | 52 | ||
53 | union nf_inet_addr { | 53 | union nf_inet_addr { |
54 | u_int32_t all[4]; | 54 | __u32 all[4]; |
55 | __be32 ip; | 55 | __be32 ip; |
56 | __be32 ip6[4]; | 56 | __be32 ip6[4]; |
57 | struct in_addr in; | 57 | struct in_addr in; |
diff --git a/include/linux/netfilter/Kbuild b/include/linux/netfilter/Kbuild index 91fef0cae42f..3aff513d12c8 100644 --- a/include/linux/netfilter/Kbuild +++ b/include/linux/netfilter/Kbuild | |||
@@ -30,7 +30,6 @@ header-y += xt_mark.h | |||
30 | header-y += xt_multiport.h | 30 | header-y += xt_multiport.h |
31 | header-y += xt_owner.h | 31 | header-y += xt_owner.h |
32 | header-y += xt_pkttype.h | 32 | header-y += xt_pkttype.h |
33 | header-y += xt_policy.h | ||
34 | header-y += xt_rateest.h | 33 | header-y += xt_rateest.h |
35 | header-y += xt_realm.h | 34 | header-y += xt_realm.h |
36 | header-y += xt_sctp.h | 35 | header-y += xt_sctp.h |
@@ -47,3 +46,4 @@ unifdef-y += nfnetlink.h | |||
47 | unifdef-y += nfnetlink_compat.h | 46 | unifdef-y += nfnetlink_compat.h |
48 | unifdef-y += x_tables.h | 47 | unifdef-y += x_tables.h |
49 | unifdef-y += xt_physdev.h | 48 | unifdef-y += xt_physdev.h |
49 | unifdef-y += xt_policy.h | ||
diff --git a/include/linux/netfilter/xt_hashlimit.h b/include/linux/netfilter/xt_hashlimit.h index 58b818ee41ca..51b18d83b477 100644 --- a/include/linux/netfilter/xt_hashlimit.h +++ b/include/linux/netfilter/xt_hashlimit.h | |||
@@ -61,7 +61,6 @@ struct xt_hashlimit_mtinfo1 { | |||
61 | 61 | ||
62 | /* Used internally by the kernel */ | 62 | /* Used internally by the kernel */ |
63 | struct xt_hashlimit_htable *hinfo __attribute__((aligned(8))); | 63 | struct xt_hashlimit_htable *hinfo __attribute__((aligned(8))); |
64 | struct xt_hashlimit_mtinfo1 *master __attribute__((aligned(8))); | ||
65 | }; | 64 | }; |
66 | 65 | ||
67 | #endif /*_XT_HASHLIMIT_H*/ | 66 | #endif /*_XT_HASHLIMIT_H*/ |
diff --git a/include/linux/ssb/ssb.h b/include/linux/ssb/ssb.h index 9d5da8b2ccf9..20add65215af 100644 --- a/include/linux/ssb/ssb.h +++ b/include/linux/ssb/ssb.h | |||
@@ -282,6 +282,13 @@ struct ssb_bus { | |||
282 | struct ssb_boardinfo boardinfo; | 282 | struct ssb_boardinfo boardinfo; |
283 | /* Contents of the SPROM. */ | 283 | /* Contents of the SPROM. */ |
284 | struct ssb_sprom sprom; | 284 | struct ssb_sprom sprom; |
285 | /* If the board has a cardbus slot, this is set to true. */ | ||
286 | bool has_cardbus_slot; | ||
287 | |||
288 | #ifdef CONFIG_SSB_EMBEDDED | ||
289 | /* Lock for GPIO register access. */ | ||
290 | spinlock_t gpio_lock; | ||
291 | #endif /* EMBEDDED */ | ||
285 | 292 | ||
286 | /* Internal-only stuff follows. Do not touch. */ | 293 | /* Internal-only stuff follows. Do not touch. */ |
287 | struct list_head list; | 294 | struct list_head list; |
@@ -294,8 +301,13 @@ struct ssb_bus { | |||
294 | 301 | ||
295 | /* The initialization-invariants. */ | 302 | /* The initialization-invariants. */ |
296 | struct ssb_init_invariants { | 303 | struct ssb_init_invariants { |
304 | /* Versioning information about the PCB. */ | ||
297 | struct ssb_boardinfo boardinfo; | 305 | struct ssb_boardinfo boardinfo; |
306 | /* The SPROM information. That's either stored in an | ||
307 | * EEPROM or NVRAM on the board. */ | ||
298 | struct ssb_sprom sprom; | 308 | struct ssb_sprom sprom; |
309 | /* If the board has a cardbus slot, this is set to true. */ | ||
310 | bool has_cardbus_slot; | ||
299 | }; | 311 | }; |
300 | /* Type of function to fetch the invariants. */ | 312 | /* Type of function to fetch the invariants. */ |
301 | typedef int (*ssb_invariants_func_t)(struct ssb_bus *bus, | 313 | typedef int (*ssb_invariants_func_t)(struct ssb_bus *bus, |
diff --git a/include/linux/ssb/ssb_driver_chipcommon.h b/include/linux/ssb/ssb_driver_chipcommon.h index 4cb995494662..536851b946f6 100644 --- a/include/linux/ssb/ssb_driver_chipcommon.h +++ b/include/linux/ssb/ssb_driver_chipcommon.h | |||
@@ -51,9 +51,12 @@ | |||
51 | #define SSB_CHIPCO_CAP_JTAGM 0x00400000 /* JTAG master present */ | 51 | #define SSB_CHIPCO_CAP_JTAGM 0x00400000 /* JTAG master present */ |
52 | #define SSB_CHIPCO_CAP_BROM 0x00800000 /* Internal boot ROM active */ | 52 | #define SSB_CHIPCO_CAP_BROM 0x00800000 /* Internal boot ROM active */ |
53 | #define SSB_CHIPCO_CAP_64BIT 0x08000000 /* 64-bit Backplane */ | 53 | #define SSB_CHIPCO_CAP_64BIT 0x08000000 /* 64-bit Backplane */ |
54 | #define SSB_CHIPCO_CAP_PMU 0x10000000 /* PMU available (rev >= 20) */ | ||
55 | #define SSB_CHIPCO_CAP_ECI 0x20000000 /* ECI available (rev >= 20) */ | ||
54 | #define SSB_CHIPCO_CORECTL 0x0008 | 56 | #define SSB_CHIPCO_CORECTL 0x0008 |
55 | #define SSB_CHIPCO_CORECTL_UARTCLK0 0x00000001 /* Drive UART with internal clock */ | 57 | #define SSB_CHIPCO_CORECTL_UARTCLK0 0x00000001 /* Drive UART with internal clock */ |
56 | #define SSB_CHIPCO_CORECTL_SE 0x00000002 /* sync clk out enable (corerev >= 3) */ | 58 | #define SSB_CHIPCO_CORECTL_SE 0x00000002 /* sync clk out enable (corerev >= 3) */ |
59 | #define SSB_CHIPCO_CORECTL_UARTCLKEN 0x00000008 /* UART clock enable (rev >= 21) */ | ||
57 | #define SSB_CHIPCO_BIST 0x000C | 60 | #define SSB_CHIPCO_BIST 0x000C |
58 | #define SSB_CHIPCO_OTPS 0x0010 /* OTP status */ | 61 | #define SSB_CHIPCO_OTPS 0x0010 /* OTP status */ |
59 | #define SSB_CHIPCO_OTPS_PROGFAIL 0x80000000 | 62 | #define SSB_CHIPCO_OTPS_PROGFAIL 0x80000000 |
@@ -357,6 +360,11 @@ struct ssb_chipcommon { | |||
357 | u16 fast_pwrup_delay; | 360 | u16 fast_pwrup_delay; |
358 | }; | 361 | }; |
359 | 362 | ||
363 | static inline bool ssb_chipco_available(struct ssb_chipcommon *cc) | ||
364 | { | ||
365 | return (cc->dev != NULL); | ||
366 | } | ||
367 | |||
360 | extern void ssb_chipcommon_init(struct ssb_chipcommon *cc); | 368 | extern void ssb_chipcommon_init(struct ssb_chipcommon *cc); |
361 | 369 | ||
362 | #include <linux/pm.h> | 370 | #include <linux/pm.h> |
@@ -382,11 +390,13 @@ extern void ssb_chipco_set_clockmode(struct ssb_chipcommon *cc, | |||
382 | extern void ssb_chipco_watchdog_timer_set(struct ssb_chipcommon *cc, | 390 | extern void ssb_chipco_watchdog_timer_set(struct ssb_chipcommon *cc, |
383 | u32 ticks); | 391 | u32 ticks); |
384 | 392 | ||
393 | /* Chipcommon GPIO pin access. */ | ||
385 | u32 ssb_chipco_gpio_in(struct ssb_chipcommon *cc, u32 mask); | 394 | u32 ssb_chipco_gpio_in(struct ssb_chipcommon *cc, u32 mask); |
386 | 395 | u32 ssb_chipco_gpio_out(struct ssb_chipcommon *cc, u32 mask, u32 value); | |
387 | void ssb_chipco_gpio_out(struct ssb_chipcommon *cc, u32 mask, u32 value); | 396 | u32 ssb_chipco_gpio_outen(struct ssb_chipcommon *cc, u32 mask, u32 value); |
388 | 397 | u32 ssb_chipco_gpio_control(struct ssb_chipcommon *cc, u32 mask, u32 value); | |
389 | void ssb_chipco_gpio_outen(struct ssb_chipcommon *cc, u32 mask, u32 value); | 398 | u32 ssb_chipco_gpio_intmask(struct ssb_chipcommon *cc, u32 mask, u32 value); |
399 | u32 ssb_chipco_gpio_polarity(struct ssb_chipcommon *cc, u32 mask, u32 value); | ||
390 | 400 | ||
391 | #ifdef CONFIG_SSB_SERIAL | 401 | #ifdef CONFIG_SSB_SERIAL |
392 | extern int ssb_chipco_serial_init(struct ssb_chipcommon *cc, | 402 | extern int ssb_chipco_serial_init(struct ssb_chipcommon *cc, |
diff --git a/include/linux/ssb/ssb_driver_extif.h b/include/linux/ssb/ssb_driver_extif.h index a9164357b5ae..91161f0aa22b 100644 --- a/include/linux/ssb/ssb_driver_extif.h +++ b/include/linux/ssb/ssb_driver_extif.h | |||
@@ -171,11 +171,15 @@ extern void ssb_extif_get_clockcontrol(struct ssb_extif *extif, | |||
171 | extern void ssb_extif_timing_init(struct ssb_extif *extif, | 171 | extern void ssb_extif_timing_init(struct ssb_extif *extif, |
172 | unsigned long ns); | 172 | unsigned long ns); |
173 | 173 | ||
174 | u32 ssb_extif_gpio_in(struct ssb_extif *extif, u32 mask); | 174 | extern void ssb_extif_watchdog_timer_set(struct ssb_extif *extif, |
175 | 175 | u32 ticks); | |
176 | void ssb_extif_gpio_out(struct ssb_extif *extif, u32 mask, u32 value); | ||
177 | 176 | ||
178 | void ssb_extif_gpio_outen(struct ssb_extif *extif, u32 mask, u32 value); | 177 | /* Extif GPIO pin access */ |
178 | u32 ssb_extif_gpio_in(struct ssb_extif *extif, u32 mask); | ||
179 | u32 ssb_extif_gpio_out(struct ssb_extif *extif, u32 mask, u32 value); | ||
180 | u32 ssb_extif_gpio_outen(struct ssb_extif *extif, u32 mask, u32 value); | ||
181 | u32 ssb_extif_gpio_polarity(struct ssb_extif *extif, u32 mask, u32 value); | ||
182 | u32 ssb_extif_gpio_intmask(struct ssb_extif *extif, u32 mask, u32 value); | ||
179 | 183 | ||
180 | #ifdef CONFIG_SSB_SERIAL | 184 | #ifdef CONFIG_SSB_SERIAL |
181 | extern int ssb_extif_serial_init(struct ssb_extif *extif, | 185 | extern int ssb_extif_serial_init(struct ssb_extif *extif, |
@@ -200,5 +204,11 @@ void ssb_extif_get_clockcontrol(struct ssb_extif *extif, | |||
200 | { | 204 | { |
201 | } | 205 | } |
202 | 206 | ||
207 | static inline | ||
208 | void ssb_extif_watchdog_timer_set(struct ssb_extif *extif, | ||
209 | u32 ticks) | ||
210 | { | ||
211 | } | ||
212 | |||
203 | #endif /* CONFIG_SSB_DRIVER_EXTIF */ | 213 | #endif /* CONFIG_SSB_DRIVER_EXTIF */ |
204 | #endif /* LINUX_SSB_EXTIFCORE_H_ */ | 214 | #endif /* LINUX_SSB_EXTIFCORE_H_ */ |
diff --git a/include/linux/ssb/ssb_driver_pci.h b/include/linux/ssb/ssb_driver_pci.h index 9cfffb7b1a27..5e25bac4ed31 100644 --- a/include/linux/ssb/ssb_driver_pci.h +++ b/include/linux/ssb/ssb_driver_pci.h | |||
@@ -51,6 +51,11 @@ | |||
51 | #define SSB_PCICORE_SBTOPCI1_MASK 0xFC000000 | 51 | #define SSB_PCICORE_SBTOPCI1_MASK 0xFC000000 |
52 | #define SSB_PCICORE_SBTOPCI2 0x0108 /* Backplane to PCI translation 2 (sbtopci2) */ | 52 | #define SSB_PCICORE_SBTOPCI2 0x0108 /* Backplane to PCI translation 2 (sbtopci2) */ |
53 | #define SSB_PCICORE_SBTOPCI2_MASK 0xC0000000 | 53 | #define SSB_PCICORE_SBTOPCI2_MASK 0xC0000000 |
54 | #define SSB_PCICORE_PCICFG0 0x0400 /* PCI config space 0 (rev >= 8) */ | ||
55 | #define SSB_PCICORE_PCICFG1 0x0500 /* PCI config space 1 (rev >= 8) */ | ||
56 | #define SSB_PCICORE_PCICFG2 0x0600 /* PCI config space 2 (rev >= 8) */ | ||
57 | #define SSB_PCICORE_PCICFG3 0x0700 /* PCI config space 3 (rev >= 8) */ | ||
58 | #define SSB_PCICORE_SPROM(wordoffset) (0x0800 + ((wordoffset) * 2)) /* SPROM shadow area (72 bytes) */ | ||
54 | 59 | ||
55 | /* SBtoPCIx */ | 60 | /* SBtoPCIx */ |
56 | #define SSB_PCICORE_SBTOPCI_MEM 0x00000000 | 61 | #define SSB_PCICORE_SBTOPCI_MEM 0x00000000 |
diff --git a/include/linux/ssb/ssb_embedded.h b/include/linux/ssb/ssb_embedded.h new file mode 100644 index 000000000000..8d8dedff059d --- /dev/null +++ b/include/linux/ssb/ssb_embedded.h | |||
@@ -0,0 +1,18 @@ | |||
1 | #ifndef LINUX_SSB_EMBEDDED_H_ | ||
2 | #define LINUX_SSB_EMBEDDED_H_ | ||
3 | |||
4 | #include <linux/types.h> | ||
5 | #include <linux/ssb/ssb.h> | ||
6 | |||
7 | |||
8 | extern int ssb_watchdog_timer_set(struct ssb_bus *bus, u32 ticks); | ||
9 | |||
10 | /* Generic GPIO API */ | ||
11 | u32 ssb_gpio_in(struct ssb_bus *bus, u32 mask); | ||
12 | u32 ssb_gpio_out(struct ssb_bus *bus, u32 mask, u32 value); | ||
13 | u32 ssb_gpio_outen(struct ssb_bus *bus, u32 mask, u32 value); | ||
14 | u32 ssb_gpio_control(struct ssb_bus *bus, u32 mask, u32 value); | ||
15 | u32 ssb_gpio_intmask(struct ssb_bus *bus, u32 mask, u32 value); | ||
16 | u32 ssb_gpio_polarity(struct ssb_bus *bus, u32 mask, u32 value); | ||
17 | |||
18 | #endif /* LINUX_SSB_EMBEDDED_H_ */ | ||
diff --git a/include/net/ip6_tunnel.h b/include/net/ip6_tunnel.h index c17fa1fdc356..6512d85f11b3 100644 --- a/include/net/ip6_tunnel.h +++ b/include/net/ip6_tunnel.h | |||
@@ -14,8 +14,6 @@ | |||
14 | /* capable of receiving packets */ | 14 | /* capable of receiving packets */ |
15 | #define IP6_TNL_F_CAP_RCV 0x20000 | 15 | #define IP6_TNL_F_CAP_RCV 0x20000 |
16 | 16 | ||
17 | #define IP6_TNL_MAX 128 | ||
18 | |||
19 | /* IPv6 tunnel */ | 17 | /* IPv6 tunnel */ |
20 | 18 | ||
21 | struct ip6_tnl { | 19 | struct ip6_tnl { |
diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c index fc60c6d096b9..77f04e49a1a0 100644 --- a/net/8021q/vlan_dev.c +++ b/net/8021q/vlan_dev.c | |||
@@ -366,8 +366,7 @@ static int vlan_dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
366 | { | 366 | { |
367 | struct net_device_stats *stats = &dev->stats; | 367 | struct net_device_stats *stats = &dev->stats; |
368 | struct vlan_ethhdr *veth = (struct vlan_ethhdr *)(skb->data); | 368 | struct vlan_ethhdr *veth = (struct vlan_ethhdr *)(skb->data); |
369 | DECLARE_MAC_BUF(mac); | 369 | |
370 | DECLARE_MAC_BUF(mac2); | ||
371 | /* Handle non-VLAN frames if they are sent to us, for example by DHCP. | 370 | /* Handle non-VLAN frames if they are sent to us, for example by DHCP. |
372 | * | 371 | * |
373 | * NOTE: THIS ASSUMES DIX ETHERNET, SPECIFICALLY NOT SUPPORTING | 372 | * NOTE: THIS ASSUMES DIX ETHERNET, SPECIFICALLY NOT SUPPORTING |
@@ -405,8 +404,11 @@ static int vlan_dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
405 | 404 | ||
406 | pr_debug("%s: about to send skb: %p to dev: %s\n", | 405 | pr_debug("%s: about to send skb: %p to dev: %s\n", |
407 | __FUNCTION__, skb, skb->dev->name); | 406 | __FUNCTION__, skb, skb->dev->name); |
408 | pr_debug(" %s %s %4hx %4hx %4hx\n", | 407 | pr_debug(" " MAC_FMT " " MAC_FMT " %4hx %4hx %4hx\n", |
409 | print_mac(mac, veth->h_dest), print_mac(mac2, veth->h_source), | 408 | veth->h_dest[0], veth->h_dest[1], veth->h_dest[2], |
409 | veth->h_dest[3], veth->h_dest[4], veth->h_dest[5], | ||
410 | veth->h_source[0], veth->h_source[1], veth->h_source[2], | ||
411 | veth->h_source[3], veth->h_source[4], veth->h_source[5], | ||
410 | veth->h_vlan_proto, veth->h_vlan_TCI, | 412 | veth->h_vlan_proto, veth->h_vlan_TCI, |
411 | veth->h_vlan_encapsulated_proto); | 413 | veth->h_vlan_encapsulated_proto); |
412 | 414 | ||
diff --git a/net/9p/trans_virtio.c b/net/9p/trans_virtio.c index 9e3d81cb9f08..de7a9f532edc 100644 --- a/net/9p/trans_virtio.c +++ b/net/9p/trans_virtio.c | |||
@@ -110,7 +110,7 @@ static struct p9_req_t *p9_lookup_tag(struct virtio_chan *c, u16 tag) | |||
110 | } | 110 | } |
111 | for (count = old_max; count < c->max_tag; count++) { | 111 | for (count = old_max; count < c->max_tag; count++) { |
112 | c->reqs[count].status = REQ_STATUS_IDLE; | 112 | c->reqs[count].status = REQ_STATUS_IDLE; |
113 | c->reqs[count].wq = kmalloc(sizeof(wait_queue_t), | 113 | c->reqs[count].wq = kmalloc(sizeof(wait_queue_head_t), |
114 | GFP_ATOMIC); | 114 | GFP_ATOMIC); |
115 | if (!c->reqs[count].wq) { | 115 | if (!c->reqs[count].wq) { |
116 | printk(KERN_ERR "Couldn't grow tag array\n"); | 116 | printk(KERN_ERR "Couldn't grow tag array\n"); |
diff --git a/net/bridge/netfilter/ebt_dnat.c b/net/bridge/netfilter/ebt_dnat.c index e700cbf634c2..ca64c1cc1b47 100644 --- a/net/bridge/netfilter/ebt_dnat.c +++ b/net/bridge/netfilter/ebt_dnat.c | |||
@@ -20,8 +20,8 @@ static int ebt_target_dnat(struct sk_buff *skb, unsigned int hooknr, | |||
20 | { | 20 | { |
21 | const struct ebt_nat_info *info = data; | 21 | const struct ebt_nat_info *info = data; |
22 | 22 | ||
23 | if (skb_make_writable(skb, 0)) | 23 | if (!skb_make_writable(skb, 0)) |
24 | return NF_DROP; | 24 | return EBT_DROP; |
25 | 25 | ||
26 | memcpy(eth_hdr(skb)->h_dest, info->mac, ETH_ALEN); | 26 | memcpy(eth_hdr(skb)->h_dest, info->mac, ETH_ALEN); |
27 | return info->target; | 27 | return info->target; |
diff --git a/net/bridge/netfilter/ebt_redirect.c b/net/bridge/netfilter/ebt_redirect.c index bfdf2fb60b1f..b8afe850cf1e 100644 --- a/net/bridge/netfilter/ebt_redirect.c +++ b/net/bridge/netfilter/ebt_redirect.c | |||
@@ -21,8 +21,8 @@ static int ebt_target_redirect(struct sk_buff *skb, unsigned int hooknr, | |||
21 | { | 21 | { |
22 | const struct ebt_redirect_info *info = data; | 22 | const struct ebt_redirect_info *info = data; |
23 | 23 | ||
24 | if (skb_make_writable(skb, 0)) | 24 | if (!skb_make_writable(skb, 0)) |
25 | return NF_DROP; | 25 | return EBT_DROP; |
26 | 26 | ||
27 | if (hooknr != NF_BR_BROUTING) | 27 | if (hooknr != NF_BR_BROUTING) |
28 | memcpy(eth_hdr(skb)->h_dest, | 28 | memcpy(eth_hdr(skb)->h_dest, |
diff --git a/net/bridge/netfilter/ebt_snat.c b/net/bridge/netfilter/ebt_snat.c index e252dabbb143..5425333dda03 100644 --- a/net/bridge/netfilter/ebt_snat.c +++ b/net/bridge/netfilter/ebt_snat.c | |||
@@ -22,8 +22,8 @@ static int ebt_target_snat(struct sk_buff *skb, unsigned int hooknr, | |||
22 | { | 22 | { |
23 | const struct ebt_nat_info *info = data; | 23 | const struct ebt_nat_info *info = data; |
24 | 24 | ||
25 | if (skb_make_writable(skb, 0)) | 25 | if (!skb_make_writable(skb, 0)) |
26 | return NF_DROP; | 26 | return EBT_DROP; |
27 | 27 | ||
28 | memcpy(eth_hdr(skb)->h_source, info->mac, ETH_ALEN); | 28 | memcpy(eth_hdr(skb)->h_source, info->mac, ETH_ALEN); |
29 | if (!(info->target & NAT_ARP_BIT) && | 29 | if (!(info->target & NAT_ARP_BIT) && |
diff --git a/net/core/dev.c b/net/core/dev.c index 908f07c3bd7d..fcdf03cf3b3f 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -2900,7 +2900,7 @@ int __dev_addr_add(struct dev_addr_list **list, int *count, | |||
2900 | } | 2900 | } |
2901 | } | 2901 | } |
2902 | 2902 | ||
2903 | da = kmalloc(sizeof(*da), GFP_ATOMIC); | 2903 | da = kzalloc(sizeof(*da), GFP_ATOMIC); |
2904 | if (da == NULL) | 2904 | if (da == NULL) |
2905 | return -ENOMEM; | 2905 | return -ENOMEM; |
2906 | memcpy(da->da_addr, addr, alen); | 2906 | memcpy(da->da_addr, addr, alen); |
diff --git a/net/core/neighbour.c b/net/core/neighbour.c index a16cf1ec5e5e..2328acbd16cd 100644 --- a/net/core/neighbour.c +++ b/net/core/neighbour.c | |||
@@ -358,11 +358,12 @@ struct neighbour *neigh_lookup(struct neigh_table *tbl, const void *pkey, | |||
358 | { | 358 | { |
359 | struct neighbour *n; | 359 | struct neighbour *n; |
360 | int key_len = tbl->key_len; | 360 | int key_len = tbl->key_len; |
361 | u32 hash_val = tbl->hash(pkey, dev); | 361 | u32 hash_val; |
362 | 362 | ||
363 | NEIGH_CACHE_STAT_INC(tbl, lookups); | 363 | NEIGH_CACHE_STAT_INC(tbl, lookups); |
364 | 364 | ||
365 | read_lock_bh(&tbl->lock); | 365 | read_lock_bh(&tbl->lock); |
366 | hash_val = tbl->hash(pkey, dev); | ||
366 | for (n = tbl->hash_buckets[hash_val & tbl->hash_mask]; n; n = n->next) { | 367 | for (n = tbl->hash_buckets[hash_val & tbl->hash_mask]; n; n = n->next) { |
367 | if (dev == n->dev && !memcmp(n->primary_key, pkey, key_len)) { | 368 | if (dev == n->dev && !memcmp(n->primary_key, pkey, key_len)) { |
368 | neigh_hold(n); | 369 | neigh_hold(n); |
@@ -379,11 +380,12 @@ struct neighbour *neigh_lookup_nodev(struct neigh_table *tbl, struct net *net, | |||
379 | { | 380 | { |
380 | struct neighbour *n; | 381 | struct neighbour *n; |
381 | int key_len = tbl->key_len; | 382 | int key_len = tbl->key_len; |
382 | u32 hash_val = tbl->hash(pkey, NULL); | 383 | u32 hash_val; |
383 | 384 | ||
384 | NEIGH_CACHE_STAT_INC(tbl, lookups); | 385 | NEIGH_CACHE_STAT_INC(tbl, lookups); |
385 | 386 | ||
386 | read_lock_bh(&tbl->lock); | 387 | read_lock_bh(&tbl->lock); |
388 | hash_val = tbl->hash(pkey, NULL); | ||
387 | for (n = tbl->hash_buckets[hash_val & tbl->hash_mask]; n; n = n->next) { | 389 | for (n = tbl->hash_buckets[hash_val & tbl->hash_mask]; n; n = n->next) { |
388 | if (!memcmp(n->primary_key, pkey, key_len) && | 390 | if (!memcmp(n->primary_key, pkey, key_len) && |
389 | (net == n->dev->nd_net)) { | 391 | (net == n->dev->nd_net)) { |
@@ -507,6 +509,7 @@ struct pneigh_entry * pneigh_lookup(struct neigh_table *tbl, | |||
507 | if (tbl->pconstructor && tbl->pconstructor(n)) { | 509 | if (tbl->pconstructor && tbl->pconstructor(n)) { |
508 | if (dev) | 510 | if (dev) |
509 | dev_put(dev); | 511 | dev_put(dev); |
512 | release_net(net); | ||
510 | kfree(n); | 513 | kfree(n); |
511 | n = NULL; | 514 | n = NULL; |
512 | goto out; | 515 | goto out; |
diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c index 61ac8d06292c..2bd9c5f7627d 100644 --- a/net/core/rtnetlink.c +++ b/net/core/rtnetlink.c | |||
@@ -689,10 +689,12 @@ const struct nla_policy ifla_policy[IFLA_MAX+1] = { | |||
689 | [IFLA_BROADCAST] = { .type = NLA_BINARY, .len = MAX_ADDR_LEN }, | 689 | [IFLA_BROADCAST] = { .type = NLA_BINARY, .len = MAX_ADDR_LEN }, |
690 | [IFLA_MAP] = { .len = sizeof(struct rtnl_link_ifmap) }, | 690 | [IFLA_MAP] = { .len = sizeof(struct rtnl_link_ifmap) }, |
691 | [IFLA_MTU] = { .type = NLA_U32 }, | 691 | [IFLA_MTU] = { .type = NLA_U32 }, |
692 | [IFLA_LINK] = { .type = NLA_U32 }, | ||
692 | [IFLA_TXQLEN] = { .type = NLA_U32 }, | 693 | [IFLA_TXQLEN] = { .type = NLA_U32 }, |
693 | [IFLA_WEIGHT] = { .type = NLA_U32 }, | 694 | [IFLA_WEIGHT] = { .type = NLA_U32 }, |
694 | [IFLA_OPERSTATE] = { .type = NLA_U8 }, | 695 | [IFLA_OPERSTATE] = { .type = NLA_U8 }, |
695 | [IFLA_LINKMODE] = { .type = NLA_U8 }, | 696 | [IFLA_LINKMODE] = { .type = NLA_U8 }, |
697 | [IFLA_LINKINFO] = { .type = NLA_NESTED }, | ||
696 | [IFLA_NET_NS_PID] = { .type = NLA_U32 }, | 698 | [IFLA_NET_NS_PID] = { .type = NLA_U32 }, |
697 | }; | 699 | }; |
698 | 700 | ||
@@ -720,6 +722,21 @@ static struct net *get_net_ns_by_pid(pid_t pid) | |||
720 | return net; | 722 | return net; |
721 | } | 723 | } |
722 | 724 | ||
725 | static int validate_linkmsg(struct net_device *dev, struct nlattr *tb[]) | ||
726 | { | ||
727 | if (dev) { | ||
728 | if (tb[IFLA_ADDRESS] && | ||
729 | nla_len(tb[IFLA_ADDRESS]) < dev->addr_len) | ||
730 | return -EINVAL; | ||
731 | |||
732 | if (tb[IFLA_BROADCAST] && | ||
733 | nla_len(tb[IFLA_BROADCAST]) < dev->addr_len) | ||
734 | return -EINVAL; | ||
735 | } | ||
736 | |||
737 | return 0; | ||
738 | } | ||
739 | |||
723 | static int do_setlink(struct net_device *dev, struct ifinfomsg *ifm, | 740 | static int do_setlink(struct net_device *dev, struct ifinfomsg *ifm, |
724 | struct nlattr **tb, char *ifname, int modified) | 741 | struct nlattr **tb, char *ifname, int modified) |
725 | { | 742 | { |
@@ -892,12 +909,7 @@ static int rtnl_setlink(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg) | |||
892 | goto errout; | 909 | goto errout; |
893 | } | 910 | } |
894 | 911 | ||
895 | if (tb[IFLA_ADDRESS] && | 912 | if ((err = validate_linkmsg(dev, tb)) < 0) |
896 | nla_len(tb[IFLA_ADDRESS]) < dev->addr_len) | ||
897 | goto errout_dev; | ||
898 | |||
899 | if (tb[IFLA_BROADCAST] && | ||
900 | nla_len(tb[IFLA_BROADCAST]) < dev->addr_len) | ||
901 | goto errout_dev; | 913 | goto errout_dev; |
902 | 914 | ||
903 | err = do_setlink(dev, ifm, tb, ifname, 0); | 915 | err = do_setlink(dev, ifm, tb, ifname, 0); |
@@ -1018,6 +1030,9 @@ replay: | |||
1018 | else | 1030 | else |
1019 | dev = NULL; | 1031 | dev = NULL; |
1020 | 1032 | ||
1033 | if ((err = validate_linkmsg(dev, tb)) < 0) | ||
1034 | return err; | ||
1035 | |||
1021 | if (tb[IFLA_LINKINFO]) { | 1036 | if (tb[IFLA_LINKINFO]) { |
1022 | err = nla_parse_nested(linkinfo, IFLA_INFO_MAX, | 1037 | err = nla_parse_nested(linkinfo, IFLA_INFO_MAX, |
1023 | tb[IFLA_LINKINFO], ifla_info_policy); | 1038 | tb[IFLA_LINKINFO], ifla_info_policy); |
diff --git a/net/ipv4/fib_hash.c b/net/ipv4/fib_hash.c index 76b9c684cccd..8d58d85dfac6 100644 --- a/net/ipv4/fib_hash.c +++ b/net/ipv4/fib_hash.c | |||
@@ -372,7 +372,8 @@ static struct fib_node *fib_find_node(struct fn_zone *fz, __be32 key) | |||
372 | static int fn_hash_insert(struct fib_table *tb, struct fib_config *cfg) | 372 | static int fn_hash_insert(struct fib_table *tb, struct fib_config *cfg) |
373 | { | 373 | { |
374 | struct fn_hash *table = (struct fn_hash *) tb->tb_data; | 374 | struct fn_hash *table = (struct fn_hash *) tb->tb_data; |
375 | struct fib_node *new_f, *f; | 375 | struct fib_node *new_f = NULL; |
376 | struct fib_node *f; | ||
376 | struct fib_alias *fa, *new_fa; | 377 | struct fib_alias *fa, *new_fa; |
377 | struct fn_zone *fz; | 378 | struct fn_zone *fz; |
378 | struct fib_info *fi; | 379 | struct fib_info *fi; |
@@ -496,7 +497,6 @@ static int fn_hash_insert(struct fib_table *tb, struct fib_config *cfg) | |||
496 | 497 | ||
497 | err = -ENOBUFS; | 498 | err = -ENOBUFS; |
498 | 499 | ||
499 | new_f = NULL; | ||
500 | if (!f) { | 500 | if (!f) { |
501 | new_f = kmem_cache_zalloc(fn_hash_kmem, GFP_KERNEL); | 501 | new_f = kmem_cache_zalloc(fn_hash_kmem, GFP_KERNEL); |
502 | if (new_f == NULL) | 502 | if (new_f == NULL) |
@@ -512,7 +512,7 @@ static int fn_hash_insert(struct fib_table *tb, struct fib_config *cfg) | |||
512 | if (new_fa->fa_info != NULL) { | 512 | if (new_fa->fa_info != NULL) { |
513 | new_fa = kmem_cache_alloc(fn_alias_kmem, GFP_KERNEL); | 513 | new_fa = kmem_cache_alloc(fn_alias_kmem, GFP_KERNEL); |
514 | if (new_fa == NULL) | 514 | if (new_fa == NULL) |
515 | goto out_free_new_f; | 515 | goto out; |
516 | } | 516 | } |
517 | new_fa->fa_info = fi; | 517 | new_fa->fa_info = fi; |
518 | new_fa->fa_tos = tos; | 518 | new_fa->fa_tos = tos; |
@@ -540,9 +540,9 @@ static int fn_hash_insert(struct fib_table *tb, struct fib_config *cfg) | |||
540 | &cfg->fc_nlinfo, 0); | 540 | &cfg->fc_nlinfo, 0); |
541 | return 0; | 541 | return 0; |
542 | 542 | ||
543 | out_free_new_f: | ||
544 | kmem_cache_free(fn_hash_kmem, new_f); | ||
545 | out: | 543 | out: |
544 | if (new_f) | ||
545 | kmem_cache_free(fn_hash_kmem, new_f); | ||
546 | fib_release_info(fi); | 546 | fib_release_info(fi); |
547 | return err; | 547 | return err; |
548 | } | 548 | } |
diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c index 63f691719353..906cb1ada4c3 100644 --- a/net/ipv4/ip_gre.c +++ b/net/ipv4/ip_gre.c | |||
@@ -259,16 +259,8 @@ static struct ip_tunnel * ipgre_tunnel_locate(struct ip_tunnel_parm *parms, int | |||
259 | 259 | ||
260 | if (parms->name[0]) | 260 | if (parms->name[0]) |
261 | strlcpy(name, parms->name, IFNAMSIZ); | 261 | strlcpy(name, parms->name, IFNAMSIZ); |
262 | else { | 262 | else |
263 | int i; | 263 | sprintf(name, "gre%%d"); |
264 | for (i=1; i<100; i++) { | ||
265 | sprintf(name, "gre%d", i); | ||
266 | if (__dev_get_by_name(&init_net, name) == NULL) | ||
267 | break; | ||
268 | } | ||
269 | if (i==100) | ||
270 | goto failed; | ||
271 | } | ||
272 | 264 | ||
273 | dev = alloc_netdev(sizeof(*t), name, ipgre_tunnel_setup); | 265 | dev = alloc_netdev(sizeof(*t), name, ipgre_tunnel_setup); |
274 | if (!dev) | 266 | if (!dev) |
diff --git a/net/ipv4/ipip.c b/net/ipv4/ipip.c index da281581692c..e77e3b855834 100644 --- a/net/ipv4/ipip.c +++ b/net/ipv4/ipip.c | |||
@@ -221,16 +221,8 @@ static struct ip_tunnel * ipip_tunnel_locate(struct ip_tunnel_parm *parms, int c | |||
221 | 221 | ||
222 | if (parms->name[0]) | 222 | if (parms->name[0]) |
223 | strlcpy(name, parms->name, IFNAMSIZ); | 223 | strlcpy(name, parms->name, IFNAMSIZ); |
224 | else { | 224 | else |
225 | int i; | 225 | sprintf(name, "tunl%%d"); |
226 | for (i=1; i<100; i++) { | ||
227 | sprintf(name, "tunl%d", i); | ||
228 | if (__dev_get_by_name(&init_net, name) == NULL) | ||
229 | break; | ||
230 | } | ||
231 | if (i==100) | ||
232 | goto failed; | ||
233 | } | ||
234 | 226 | ||
235 | dev = alloc_netdev(sizeof(*t), name, ipip_tunnel_setup); | 227 | dev = alloc_netdev(sizeof(*t), name, ipip_tunnel_setup); |
236 | if (dev == NULL) | 228 | if (dev == NULL) |
diff --git a/net/ipv4/netfilter/arpt_mangle.c b/net/ipv4/netfilter/arpt_mangle.c index 45fa4e20094a..3f4222b0a803 100644 --- a/net/ipv4/netfilter/arpt_mangle.c +++ b/net/ipv4/netfilter/arpt_mangle.c | |||
@@ -19,7 +19,7 @@ target(struct sk_buff *skb, | |||
19 | unsigned char *arpptr; | 19 | unsigned char *arpptr; |
20 | int pln, hln; | 20 | int pln, hln; |
21 | 21 | ||
22 | if (skb_make_writable(skb, skb->len)) | 22 | if (!skb_make_writable(skb, skb->len)) |
23 | return NF_DROP; | 23 | return NF_DROP; |
24 | 24 | ||
25 | arp = arp_hdr(skb); | 25 | arp = arp_hdr(skb); |
diff --git a/net/ipv4/netfilter/ip_queue.c b/net/ipv4/netfilter/ip_queue.c index 6bda1102851b..fe05da41d6ba 100644 --- a/net/ipv4/netfilter/ip_queue.c +++ b/net/ipv4/netfilter/ip_queue.c | |||
@@ -283,8 +283,8 @@ static int | |||
283 | ipq_mangle_ipv4(ipq_verdict_msg_t *v, struct nf_queue_entry *e) | 283 | ipq_mangle_ipv4(ipq_verdict_msg_t *v, struct nf_queue_entry *e) |
284 | { | 284 | { |
285 | int diff; | 285 | int diff; |
286 | int err; | ||
287 | struct iphdr *user_iph = (struct iphdr *)v->payload; | 286 | struct iphdr *user_iph = (struct iphdr *)v->payload; |
287 | struct sk_buff *nskb; | ||
288 | 288 | ||
289 | if (v->data_len < sizeof(*user_iph)) | 289 | if (v->data_len < sizeof(*user_iph)) |
290 | return 0; | 290 | return 0; |
@@ -296,14 +296,16 @@ ipq_mangle_ipv4(ipq_verdict_msg_t *v, struct nf_queue_entry *e) | |||
296 | if (v->data_len > 0xFFFF) | 296 | if (v->data_len > 0xFFFF) |
297 | return -EINVAL; | 297 | return -EINVAL; |
298 | if (diff > skb_tailroom(e->skb)) { | 298 | if (diff > skb_tailroom(e->skb)) { |
299 | err = pskb_expand_head(e->skb, 0, | 299 | nskb = skb_copy_expand(e->skb, 0, |
300 | diff - skb_tailroom(e->skb), | 300 | diff - skb_tailroom(e->skb), |
301 | GFP_ATOMIC); | 301 | GFP_ATOMIC); |
302 | if (err) { | 302 | if (!nskb) { |
303 | printk(KERN_WARNING "ip_queue: error " | 303 | printk(KERN_WARNING "ip_queue: error " |
304 | "in mangle, dropping packet: %d\n", -err); | 304 | "in mangle, dropping packet\n"); |
305 | return err; | 305 | return -ENOMEM; |
306 | } | 306 | } |
307 | kfree_skb(e->skb); | ||
308 | e->skb = nskb; | ||
307 | } | 309 | } |
308 | skb_put(e->skb, diff); | 310 | skb_put(e->skb, diff); |
309 | } | 311 | } |
diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c index cd940647bd12..2a124e9a1b2d 100644 --- a/net/ipv6/ip6_tunnel.c +++ b/net/ipv6/ip6_tunnel.c | |||
@@ -229,18 +229,11 @@ static struct ip6_tnl *ip6_tnl_create(struct ip6_tnl_parm *p) | |||
229 | char name[IFNAMSIZ]; | 229 | char name[IFNAMSIZ]; |
230 | int err; | 230 | int err; |
231 | 231 | ||
232 | if (p->name[0]) { | 232 | if (p->name[0]) |
233 | strlcpy(name, p->name, IFNAMSIZ); | 233 | strlcpy(name, p->name, IFNAMSIZ); |
234 | } else { | 234 | else |
235 | int i; | 235 | sprintf(name, "ip6tnl%%d"); |
236 | for (i = 1; i < IP6_TNL_MAX; i++) { | 236 | |
237 | sprintf(name, "ip6tnl%d", i); | ||
238 | if (__dev_get_by_name(&init_net, name) == NULL) | ||
239 | break; | ||
240 | } | ||
241 | if (i == IP6_TNL_MAX) | ||
242 | goto failed; | ||
243 | } | ||
244 | dev = alloc_netdev(sizeof (*t), name, ip6_tnl_dev_setup); | 237 | dev = alloc_netdev(sizeof (*t), name, ip6_tnl_dev_setup); |
245 | if (dev == NULL) | 238 | if (dev == NULL) |
246 | goto failed; | 239 | goto failed; |
diff --git a/net/ipv6/netfilter/ip6_queue.c b/net/ipv6/netfilter/ip6_queue.c index e869916b05f1..cc2f9afcf808 100644 --- a/net/ipv6/netfilter/ip6_queue.c +++ b/net/ipv6/netfilter/ip6_queue.c | |||
@@ -285,8 +285,8 @@ static int | |||
285 | ipq_mangle_ipv6(ipq_verdict_msg_t *v, struct nf_queue_entry *e) | 285 | ipq_mangle_ipv6(ipq_verdict_msg_t *v, struct nf_queue_entry *e) |
286 | { | 286 | { |
287 | int diff; | 287 | int diff; |
288 | int err; | ||
289 | struct ipv6hdr *user_iph = (struct ipv6hdr *)v->payload; | 288 | struct ipv6hdr *user_iph = (struct ipv6hdr *)v->payload; |
289 | struct sk_buff *nskb; | ||
290 | 290 | ||
291 | if (v->data_len < sizeof(*user_iph)) | 291 | if (v->data_len < sizeof(*user_iph)) |
292 | return 0; | 292 | return 0; |
@@ -298,14 +298,16 @@ ipq_mangle_ipv6(ipq_verdict_msg_t *v, struct nf_queue_entry *e) | |||
298 | if (v->data_len > 0xFFFF) | 298 | if (v->data_len > 0xFFFF) |
299 | return -EINVAL; | 299 | return -EINVAL; |
300 | if (diff > skb_tailroom(e->skb)) { | 300 | if (diff > skb_tailroom(e->skb)) { |
301 | err = pskb_expand_head(e->skb, 0, | 301 | nskb = skb_copy_expand(e->skb, 0, |
302 | diff - skb_tailroom(e->skb), | 302 | diff - skb_tailroom(e->skb), |
303 | GFP_ATOMIC); | 303 | GFP_ATOMIC); |
304 | if (err) { | 304 | if (!nskb) { |
305 | printk(KERN_WARNING "ip6_queue: OOM " | 305 | printk(KERN_WARNING "ip6_queue: OOM " |
306 | "in mangle, dropping packet\n"); | 306 | "in mangle, dropping packet\n"); |
307 | return err; | 307 | return -ENOMEM; |
308 | } | 308 | } |
309 | kfree_skb(e->skb); | ||
310 | e->skb = nskb; | ||
309 | } | 311 | } |
310 | skb_put(e->skb, diff); | 312 | skb_put(e->skb, diff); |
311 | } | 313 | } |
diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c index e77239d02bf5..dde7801abeff 100644 --- a/net/ipv6/sit.c +++ b/net/ipv6/sit.c | |||
@@ -164,16 +164,8 @@ static struct ip_tunnel * ipip6_tunnel_locate(struct ip_tunnel_parm *parms, int | |||
164 | 164 | ||
165 | if (parms->name[0]) | 165 | if (parms->name[0]) |
166 | strlcpy(name, parms->name, IFNAMSIZ); | 166 | strlcpy(name, parms->name, IFNAMSIZ); |
167 | else { | 167 | else |
168 | int i; | 168 | sprintf(name, "sit%%d"); |
169 | for (i=1; i<100; i++) { | ||
170 | sprintf(name, "sit%d", i); | ||
171 | if (__dev_get_by_name(&init_net, name) == NULL) | ||
172 | break; | ||
173 | } | ||
174 | if (i==100) | ||
175 | goto failed; | ||
176 | } | ||
177 | 169 | ||
178 | dev = alloc_netdev(sizeof(*t), name, ipip6_tunnel_setup); | 170 | dev = alloc_netdev(sizeof(*t), name, ipip6_tunnel_setup); |
179 | if (dev == NULL) | 171 | if (dev == NULL) |
diff --git a/net/netfilter/nfnetlink_queue.c b/net/netfilter/nfnetlink_queue.c index a48b20fe9cd6..0043d3a9f87e 100644 --- a/net/netfilter/nfnetlink_queue.c +++ b/net/netfilter/nfnetlink_queue.c | |||
@@ -443,8 +443,8 @@ err_out: | |||
443 | static int | 443 | static int |
444 | nfqnl_mangle(void *data, int data_len, struct nf_queue_entry *e) | 444 | nfqnl_mangle(void *data, int data_len, struct nf_queue_entry *e) |
445 | { | 445 | { |
446 | struct sk_buff *nskb; | ||
446 | int diff; | 447 | int diff; |
447 | int err; | ||
448 | 448 | ||
449 | diff = data_len - e->skb->len; | 449 | diff = data_len - e->skb->len; |
450 | if (diff < 0) { | 450 | if (diff < 0) { |
@@ -454,14 +454,16 @@ nfqnl_mangle(void *data, int data_len, struct nf_queue_entry *e) | |||
454 | if (data_len > 0xFFFF) | 454 | if (data_len > 0xFFFF) |
455 | return -EINVAL; | 455 | return -EINVAL; |
456 | if (diff > skb_tailroom(e->skb)) { | 456 | if (diff > skb_tailroom(e->skb)) { |
457 | err = pskb_expand_head(e->skb, 0, | 457 | nskb = skb_copy_expand(e->skb, 0, |
458 | diff - skb_tailroom(e->skb), | 458 | diff - skb_tailroom(e->skb), |
459 | GFP_ATOMIC); | 459 | GFP_ATOMIC); |
460 | if (err) { | 460 | if (!nskb) { |
461 | printk(KERN_WARNING "nf_queue: OOM " | 461 | printk(KERN_WARNING "nf_queue: OOM " |
462 | "in mangle, dropping packet\n"); | 462 | "in mangle, dropping packet\n"); |
463 | return err; | 463 | return -ENOMEM; |
464 | } | 464 | } |
465 | kfree_skb(e->skb); | ||
466 | e->skb = nskb; | ||
465 | } | 467 | } |
466 | skb_put(e->skb, diff); | 468 | skb_put(e->skb, diff); |
467 | } | 469 | } |
diff --git a/net/netfilter/xt_hashlimit.c b/net/netfilter/xt_hashlimit.c index 744c7f2ab0b1..5418ce59ac3a 100644 --- a/net/netfilter/xt_hashlimit.c +++ b/net/netfilter/xt_hashlimit.c | |||
@@ -774,9 +774,6 @@ hashlimit_mt_check(const char *tablename, const void *inf, | |||
774 | return false; | 774 | return false; |
775 | } | 775 | } |
776 | mutex_unlock(&hlimit_mutex); | 776 | mutex_unlock(&hlimit_mutex); |
777 | |||
778 | /* Ugly hack: For SMP, we only want to use one set */ | ||
779 | info->master = info; | ||
780 | return true; | 777 | return true; |
781 | } | 778 | } |
782 | 779 | ||
diff --git a/net/netfilter/xt_iprange.c b/net/netfilter/xt_iprange.c index 4f984dc60319..500528d60cd7 100644 --- a/net/netfilter/xt_iprange.c +++ b/net/netfilter/xt_iprange.c | |||
@@ -102,7 +102,7 @@ iprange_ipv6_sub(const struct in6_addr *a, const struct in6_addr *b) | |||
102 | int r; | 102 | int r; |
103 | 103 | ||
104 | for (i = 0; i < 4; ++i) { | 104 | for (i = 0; i < 4; ++i) { |
105 | r = (__force u32)a->s6_addr32[i] - (__force u32)b->s6_addr32[i]; | 105 | r = ntohl(a->s6_addr32[i]) - ntohl(b->s6_addr32[i]); |
106 | if (r != 0) | 106 | if (r != 0) |
107 | return r; | 107 | return r; |
108 | } | 108 | } |
diff --git a/net/netfilter/xt_u32.c b/net/netfilter/xt_u32.c index 9b8ed390a8e0..627e0f336d54 100644 --- a/net/netfilter/xt_u32.c +++ b/net/netfilter/xt_u32.c | |||
@@ -26,7 +26,6 @@ static bool u32_match_it(const struct xt_u32 *data, | |||
26 | u_int32_t pos; | 26 | u_int32_t pos; |
27 | u_int32_t val; | 27 | u_int32_t val; |
28 | u_int32_t at; | 28 | u_int32_t at; |
29 | int ret; | ||
30 | 29 | ||
31 | /* | 30 | /* |
32 | * Small example: "0 >> 28 == 4 && 8 & 0xFF0000 >> 16 = 6, 17" | 31 | * Small example: "0 >> 28 == 4 && 8 & 0xFF0000 >> 16 = 6, 17" |
@@ -40,8 +39,8 @@ static bool u32_match_it(const struct xt_u32 *data, | |||
40 | if (skb->len < 4 || pos > skb->len - 4) | 39 | if (skb->len < 4 || pos > skb->len - 4) |
41 | return false; | 40 | return false; |
42 | 41 | ||
43 | ret = skb_copy_bits(skb, pos, &n, sizeof(n)); | 42 | if (skb_copy_bits(skb, pos, &n, sizeof(n)) < 0) |
44 | BUG_ON(ret < 0); | 43 | BUG(); |
45 | val = ntohl(n); | 44 | val = ntohl(n); |
46 | nnums = ct->nnums; | 45 | nnums = ct->nnums; |
47 | 46 | ||
@@ -67,9 +66,9 @@ static bool u32_match_it(const struct xt_u32 *data, | |||
67 | pos > skb->len - at - 4) | 66 | pos > skb->len - at - 4) |
68 | return false; | 67 | return false; |
69 | 68 | ||
70 | ret = skb_copy_bits(skb, at + pos, &n, | 69 | if (skb_copy_bits(skb, at + pos, &n, |
71 | sizeof(n)); | 70 | sizeof(n)) < 0) |
72 | BUG_ON(ret < 0); | 71 | BUG(); |
73 | val = ntohl(n); | 72 | val = ntohl(n); |
74 | break; | 73 | break; |
75 | } | 74 | } |
diff --git a/net/sctp/socket.c b/net/sctp/socket.c index d47d5787e2e5..44797ad88a05 100644 --- a/net/sctp/socket.c +++ b/net/sctp/socket.c | |||
@@ -6488,6 +6488,7 @@ struct proto sctp_prot = { | |||
6488 | .memory_pressure = &sctp_memory_pressure, | 6488 | .memory_pressure = &sctp_memory_pressure, |
6489 | .enter_memory_pressure = sctp_enter_memory_pressure, | 6489 | .enter_memory_pressure = sctp_enter_memory_pressure, |
6490 | .memory_allocated = &sctp_memory_allocated, | 6490 | .memory_allocated = &sctp_memory_allocated, |
6491 | .sockets_allocated = &sctp_sockets_allocated, | ||
6491 | REF_PROTO_INUSE(sctp) | 6492 | REF_PROTO_INUSE(sctp) |
6492 | }; | 6493 | }; |
6493 | 6494 | ||
@@ -6521,6 +6522,7 @@ struct proto sctpv6_prot = { | |||
6521 | .memory_pressure = &sctp_memory_pressure, | 6522 | .memory_pressure = &sctp_memory_pressure, |
6522 | .enter_memory_pressure = sctp_enter_memory_pressure, | 6523 | .enter_memory_pressure = sctp_enter_memory_pressure, |
6523 | .memory_allocated = &sctp_memory_allocated, | 6524 | .memory_allocated = &sctp_memory_allocated, |
6525 | .sockets_allocated = &sctp_sockets_allocated, | ||
6524 | REF_PROTO_INUSE(sctpv6) | 6526 | REF_PROTO_INUSE(sctpv6) |
6525 | }; | 6527 | }; |
6526 | #endif /* defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) */ | 6528 | #endif /* defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) */ |