Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6: (56 commits)
sky2: Fix oops in sky2_xmit_frame() after TX timeout
Documentation/3c509: document ethtool support
af_packet: Don't use skb after dev_queue_xmit()
vxge: use pci_dma_mapping_error to test return value
netfilter: ebtables: enforce CAP_NET_ADMIN
e1000e: fix and commonize code for setting the receive address registers
e1000e: e1000e_enable_tx_pkt_filtering() returns wrong value
e1000e: perform 10/100 adaptive IFS only on parts that support it
e1000e: don't accumulate PHY statistics on PHY read failure
e1000e: call pci_save_state() after pci_restore_state()
netxen: update version to 4.0.72
netxen: fix set mac addr
netxen: fix smatch warning
netxen: fix tx ring memory leak
tcp: update the netstamp_needed counter when cloning sockets
TI DaVinci EMAC: Handle emac module clock correctly.
dmfe/tulip: Let dmfe handle DM910x except for SPARC on-board chips
ixgbe: Fix compiler warning about variable being used uninitialized
netfilter: nf_ct_ftp: fix out of bounds read in update_nl_seq()
mv643xx_eth: don't include cache padding in rx desc buffer size
...

Fix trivial conflict in drivers/scsi/cxgb3i/cxgb3i_offload.c

+525 -312
+8 -4
Documentation/networking/3c509.txt
··· 48 48 This configures the first found 3c509 card for IRQ 10, base I/O 0x310, and 49 49 transceiver type 3 (10base2). The flag "0x3c509" must be set to avoid conflicts 50 50 with other card types when overriding the I/O address. When the driver is 51 - loaded as a module, only the IRQ and transceiver setting may be overridden. 52 - For example, setting two cards to 10base2/IRQ10 and AUI/IRQ11 is done by using 53 - the xcvr and irq module options: 51 + loaded as a module, only the IRQ may be overridden. For example, 52 + setting two cards to IRQ10 and IRQ11 is done by using the irq module 53 + option: 54 54 55 - options 3c509 xcvr=3,1 irq=10,11 55 + options 3c509 irq=10,11 56 56 57 57 58 58 (2) Full-duplex mode ··· 77 77 itself full-duplex capable. This is almost certainly one of two things: a full- 78 78 duplex-capable Ethernet switch (*not* a hub), or a full-duplex-capable NIC on 79 79 another system that's connected directly to the 3c509B via a crossover cable. 80 + 81 + Full-duplex mode can be enabled using 'ethtool'. 80 82 81 83 /////Extremely important caution concerning full-duplex mode///// 82 84 Understand that the 3c509B's hardware's full-duplex support is much more ··· 115 113 never automatically enable full-duplex mode in an existing installation; 116 114 it must always be explicitly enabled via one of these code in order to be 117 115 activated. 116 + 117 + The transceiver type can be changed using 'ethtool'. 118 118 119 119 120 120 (4a) Interpretation of error messages and common problems
+1 -1
drivers/isdn/hardware/mISDN/hfcmulti.c
··· 3152 3152 hfcmulti_pcm(struct hfc_multi *hc, int ch, int slot_tx, int bank_tx, 3153 3153 int slot_rx, int bank_rx) 3154 3154 { 3155 - if (slot_rx < 0 || slot_rx < 0 || bank_tx < 0 || bank_rx < 0) { 3155 + if (slot_tx < 0 || slot_rx < 0 || bank_tx < 0 || bank_rx < 0) { 3156 3156 /* disable PCM */ 3157 3157 mode_hfcmulti(hc, ch, hc->chan[ch].protocol, -1, 0, -1, 0); 3158 3158 return;
+1 -1
drivers/net/atarilance.c
··· 663 663 while (--i > 0) 664 664 if (DREG & CSR0_IDON) 665 665 break; 666 - if (i < 0 || (DREG & CSR0_ERR)) { 666 + if (i <= 0 || (DREG & CSR0_ERR)) { 667 667 DPRINTK( 2, ( "lance_open(): opening %s failed, i=%d, csr0=%04x\n", 668 668 dev->name, i, DREG )); 669 669 DREG = CSR0_STOP;
+5 -2
drivers/net/atlx/atl2.c
··· 1959 1959 return -ENOMEM; 1960 1960 1961 1961 for (i = first_dword; i < last_dword; i++) { 1962 - if (!atl2_read_eeprom(hw, i*4, &(eeprom_buff[i-first_dword]))) 1963 - return -EIO; 1962 + if (!atl2_read_eeprom(hw, i*4, &(eeprom_buff[i-first_dword]))) { 1963 + ret_val = -EIO; 1964 + goto free; 1965 + } 1964 1966 } 1965 1967 1966 1968 memcpy(bytes, (u8 *)eeprom_buff + (eeprom->offset & 3), 1967 1969 eeprom->len); 1970 + free: 1968 1971 kfree(eeprom_buff); 1969 1972 1970 1973 return ret_val;
+1 -1
drivers/net/can/mcp251x.c
··· 990 990 goto error_tx_buf; 991 991 } 992 992 priv->spi_rx_buf = kmalloc(SPI_TRANSFER_BUF_LEN, GFP_KERNEL); 993 - if (!priv->spi_tx_buf) { 993 + if (!priv->spi_rx_buf) { 994 994 ret = -ENOMEM; 995 995 goto error_rx_buf; 996 996 }
+1 -2
drivers/net/cs89x0.c
··· 1325 1325 write_irq(dev, lp->chip_type, dev->irq); 1326 1326 ret = request_irq(dev->irq, net_interrupt, 0, dev->name, dev); 1327 1327 if (ret) { 1328 - if (net_debug) 1329 - printk(KERN_DEBUG "cs89x0: request_irq(%d) failed\n", dev->irq); 1328 + printk(KERN_ERR "cs89x0: request_irq(%d) failed\n", dev->irq); 1330 1329 goto bad_out; 1331 1330 } 1332 1331 }
+3 -1
drivers/net/davinci_emac.c
··· 2711 2711 SET_ETHTOOL_OPS(ndev, &ethtool_ops); 2712 2712 netif_napi_add(ndev, &priv->napi, emac_poll, EMAC_POLL_WEIGHT); 2713 2713 2714 + clk_enable(emac_clk); 2715 + 2714 2716 /* register the network device */ 2715 2717 SET_NETDEV_DEV(ndev, &pdev->dev); 2716 2718 rc = register_netdev(ndev); ··· 2722 2720 goto netdev_reg_err; 2723 2721 } 2724 2722 2725 - clk_enable(emac_clk); 2726 2723 2727 2724 /* MII/Phy intialisation, mdio bus registration */ 2728 2725 emac_mii = mdiobus_alloc(); ··· 2761 2760 2762 2761 netdev_reg_err: 2763 2762 mdio_alloc_err: 2763 + clk_disable(emac_clk); 2764 2764 no_irq_res: 2765 2765 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 2766 2766 release_mem_region(res->start, res->end - res->start + 1);
+2
drivers/net/e1000e/82571.c
··· 237 237 /* Set if manageability features are enabled. */ 238 238 mac->arc_subsystem_valid = (er32(FWSM) & E1000_FWSM_MODE_MASK) 239 239 ? true : false; 240 + /* Adaptive IFS supported */ 241 + mac->adaptive_ifs = true; 240 242 241 243 /* check for link */ 242 244 switch (hw->phy.media_type) {
+2
drivers/net/e1000e/es2lan.c
··· 224 224 /* Set if manageability features are enabled. */ 225 225 mac->arc_subsystem_valid = (er32(FWSM) & E1000_FWSM_MODE_MASK) 226 226 ? true : false; 227 + /* Adaptive IFS not supported */ 228 + mac->adaptive_ifs = false; 227 229 228 230 /* check for link */ 229 231 switch (hw->phy.media_type) {
+1
drivers/net/e1000e/hw.h
··· 818 818 819 819 u8 forced_speed_duplex; 820 820 821 + bool adaptive_ifs; 821 822 bool arc_subsystem_valid; 822 823 bool autoneg; 823 824 bool autoneg_failed;
+2
drivers/net/e1000e/ich8lan.c
··· 454 454 mac->rar_entry_count--; 455 455 /* Set if manageability features are enabled. */ 456 456 mac->arc_subsystem_valid = true; 457 + /* Adaptive IFS supported */ 458 + mac->adaptive_ifs = true; 457 459 458 460 /* LED operations */ 459 461 switch (mac->type) {
+38 -16
drivers/net/e1000e/lib.c
··· 125 125 void e1000e_init_rx_addrs(struct e1000_hw *hw, u16 rar_count) 126 126 { 127 127 u32 i; 128 + u8 mac_addr[ETH_ALEN] = {0}; 128 129 129 130 /* Setup the receive address */ 130 131 e_dbg("Programming MAC Address into RAR[0]\n"); ··· 134 133 135 134 /* Zero out the other (rar_entry_count - 1) receive addresses */ 136 135 e_dbg("Clearing RAR[1-%u]\n", rar_count-1); 137 - for (i = 1; i < rar_count; i++) { 138 - E1000_WRITE_REG_ARRAY(hw, E1000_RA, (i << 1), 0); 139 - e1e_flush(); 140 - E1000_WRITE_REG_ARRAY(hw, E1000_RA, ((i << 1) + 1), 0); 141 - e1e_flush(); 142 - } 136 + for (i = 1; i < rar_count; i++) 137 + e1000e_rar_set(hw, mac_addr, i); 143 138 } 144 139 145 140 /** ··· 161 164 162 165 rar_high = ((u32) addr[4] | ((u32) addr[5] << 8)); 163 166 164 - rar_high |= E1000_RAH_AV; 167 + /* If MAC address zero, no need to set the AV bit */ 168 + if (rar_low || rar_high) 169 + rar_high |= E1000_RAH_AV; 165 170 166 - E1000_WRITE_REG_ARRAY(hw, E1000_RA, (index << 1), rar_low); 167 - E1000_WRITE_REG_ARRAY(hw, E1000_RA, ((index << 1) + 1), rar_high); 171 + /* 172 + * Some bridges will combine consecutive 32-bit writes into 173 + * a single burst write, which will malfunction on some parts. 174 + * The flushes avoid this. 175 + */ 176 + ew32(RAL(index), rar_low); 177 + e1e_flush(); 178 + ew32(RAH(index), rar_high); 179 + e1e_flush(); 168 180 } 169 181 170 182 /** ··· 1615 1609 { 1616 1610 struct e1000_mac_info *mac = &hw->mac; 1617 1611 1612 + if (!mac->adaptive_ifs) { 1613 + e_dbg("Not in Adaptive IFS mode!\n"); 1614 + goto out; 1615 + } 1616 + 1618 1617 mac->current_ifs_val = 0; 1619 1618 mac->ifs_min_val = IFS_MIN; 1620 1619 mac->ifs_max_val = IFS_MAX; ··· 1628 1617 1629 1618 mac->in_ifs_mode = false; 1630 1619 ew32(AIT, 0); 1620 + out: 1621 + return; 1631 1622 } 1632 1623 1633 1624 /** ··· 1642 1629 void e1000e_update_adaptive(struct e1000_hw *hw) 1643 1630 { 1644 1631 struct e1000_mac_info *mac = &hw->mac; 1632 + 1633 + if (!mac->adaptive_ifs) { 1634 + e_dbg("Not in Adaptive IFS mode!\n"); 1635 + goto out; 1636 + } 1645 1637 1646 1638 if ((mac->collision_delta * mac->ifs_ratio) > mac->tx_packet_delta) { 1647 1639 if (mac->tx_packet_delta > MIN_NUM_XMITS) { ··· 1668 1650 ew32(AIT, 0); 1669 1651 } 1670 1652 } 1653 + out: 1654 + return; 1671 1655 } 1672 1656 1673 1657 /** ··· 2307 2287 s32 ret_val, hdr_csum, csum; 2308 2288 u8 i, len; 2309 2289 2290 + hw->mac.tx_pkt_filtering = true; 2291 + 2310 2292 /* No manageability, no filtering */ 2311 2293 if (!e1000e_check_mng_mode(hw)) { 2312 2294 hw->mac.tx_pkt_filtering = false; 2313 - return 0; 2295 + goto out; 2314 2296 } 2315 2297 2316 2298 /* ··· 2320 2298 * reason, disable filtering. 2321 2299 */ 2322 2300 ret_val = e1000_mng_enable_host_if(hw); 2323 - if (ret_val != 0) { 2301 + if (ret_val) { 2324 2302 hw->mac.tx_pkt_filtering = false; 2325 - return ret_val; 2303 + goto out; 2326 2304 } 2327 2305 2328 2306 /* Read in the header. Length and offset are in dwords. */ ··· 2341 2319 */ 2342 2320 if ((hdr_csum != csum) || (hdr->signature != E1000_IAMT_SIGNATURE)) { 2343 2321 hw->mac.tx_pkt_filtering = true; 2344 - return 1; 2322 + goto out; 2345 2323 } 2346 2324 2347 2325 /* Cookie area is valid, make the final check for filtering. */ 2348 2326 if (!(hdr->status & E1000_MNG_DHCP_COOKIE_STATUS_PARSING)) { 2349 2327 hw->mac.tx_pkt_filtering = false; 2350 - return 0; 2328 + goto out; 2351 2329 } 2352 2330 2353 - hw->mac.tx_pkt_filtering = true; 2354 - return 1; 2331 + out: 2332 + return hw->mac.tx_pkt_filtering; 2355 2333 } 2356 2334 2357 2335 /**
+16 -14
drivers/net/e1000e/netdev.c
··· 3315 3315 if ((hw->phy.type == e1000_phy_82578) || 3316 3316 (hw->phy.type == e1000_phy_82577)) { 3317 3317 e1e_rphy(hw, HV_SCC_UPPER, &phy_data); 3318 - e1e_rphy(hw, HV_SCC_LOWER, &phy_data); 3319 - adapter->stats.scc += phy_data; 3318 + if (!e1e_rphy(hw, HV_SCC_LOWER, &phy_data)) 3319 + adapter->stats.scc += phy_data; 3320 3320 3321 3321 e1e_rphy(hw, HV_ECOL_UPPER, &phy_data); 3322 - e1e_rphy(hw, HV_ECOL_LOWER, &phy_data); 3323 - adapter->stats.ecol += phy_data; 3322 + if (!e1e_rphy(hw, HV_ECOL_LOWER, &phy_data)) 3323 + adapter->stats.ecol += phy_data; 3324 3324 3325 3325 e1e_rphy(hw, HV_MCC_UPPER, &phy_data); 3326 - e1e_rphy(hw, HV_MCC_LOWER, &phy_data); 3327 - adapter->stats.mcc += phy_data; 3326 + if (!e1e_rphy(hw, HV_MCC_LOWER, &phy_data)) 3327 + adapter->stats.mcc += phy_data; 3328 3328 3329 3329 e1e_rphy(hw, HV_LATECOL_UPPER, &phy_data); 3330 - e1e_rphy(hw, HV_LATECOL_LOWER, &phy_data); 3331 - adapter->stats.latecol += phy_data; 3330 + if (!e1e_rphy(hw, HV_LATECOL_LOWER, &phy_data)) 3331 + adapter->stats.latecol += phy_data; 3332 3332 3333 3333 e1e_rphy(hw, HV_DC_UPPER, &phy_data); 3334 - e1e_rphy(hw, HV_DC_LOWER, &phy_data); 3335 - adapter->stats.dc += phy_data; 3334 + if (!e1e_rphy(hw, HV_DC_LOWER, &phy_data)) 3335 + adapter->stats.dc += phy_data; 3336 3336 } else { 3337 3337 adapter->stats.scc += er32(SCC); 3338 3338 adapter->stats.ecol += er32(ECOL); ··· 3360 3360 if ((hw->phy.type == e1000_phy_82578) || 3361 3361 (hw->phy.type == e1000_phy_82577)) { 3362 3362 e1e_rphy(hw, HV_COLC_UPPER, &phy_data); 3363 - e1e_rphy(hw, HV_COLC_LOWER, &phy_data); 3364 - hw->mac.collision_delta = phy_data; 3363 + if (!e1e_rphy(hw, HV_COLC_LOWER, &phy_data)) 3364 + hw->mac.collision_delta = phy_data; 3365 3365 } else { 3366 3366 hw->mac.collision_delta = er32(COLC); 3367 3367 } ··· 3372 3372 if ((hw->phy.type == e1000_phy_82578) || 3373 3373 (hw->phy.type == e1000_phy_82577)) { 3374 3374 e1e_rphy(hw, HV_TNCRS_UPPER, &phy_data); 3375 - e1e_rphy(hw, HV_TNCRS_LOWER, &phy_data); 3376 - adapter->stats.tncrs += phy_data; 3375 + if (!e1e_rphy(hw, HV_TNCRS_LOWER, &phy_data)) 3376 + adapter->stats.tncrs += phy_data; 3377 3377 } else { 3378 3378 if ((hw->mac.type != e1000_82574) && 3379 3379 (hw->mac.type != e1000_82583)) ··· 4674 4674 4675 4675 pci_set_power_state(pdev, PCI_D0); 4676 4676 pci_restore_state(pdev); 4677 + pci_save_state(pdev); 4677 4678 e1000e_disable_l1aspm(pdev); 4678 4679 4679 4680 err = pci_enable_device_mem(pdev); ··· 4826 4825 } else { 4827 4826 pci_set_master(pdev); 4828 4827 pci_restore_state(pdev); 4828 + pci_save_state(pdev); 4829 4829 4830 4830 pci_enable_wake(pdev, PCI_D3hot, 0); 4831 4831 pci_enable_wake(pdev, PCI_D3cold, 0);
+23 -7
drivers/net/fsl_pq_mdio.c
··· 46 46 #include "gianfar.h" 47 47 #include "fsl_pq_mdio.h" 48 48 49 + struct fsl_pq_mdio_priv { 50 + void __iomem *map; 51 + struct fsl_pq_mdio __iomem *regs; 52 + }; 53 + 49 54 /* 50 55 * Write value to the PHY at mii_id at register regnum, 51 56 * on the bus attached to the local interface, which may be different from the ··· 110 105 111 106 static struct fsl_pq_mdio __iomem *fsl_pq_mdio_get_regs(struct mii_bus *bus) 112 107 { 113 - return (void __iomem __force *)bus->priv; 108 + struct fsl_pq_mdio_priv *priv = bus->priv; 109 + 110 + return priv->regs; 114 111 } 115 112 116 113 /* ··· 273 266 { 274 267 struct device_node *np = ofdev->node; 275 268 struct device_node *tbi; 269 + struct fsl_pq_mdio_priv *priv; 276 270 struct fsl_pq_mdio __iomem *regs = NULL; 277 271 void __iomem *map; 278 272 u32 __iomem *tbipa; ··· 282 274 u64 addr = 0, size = 0; 283 275 int err = 0; 284 276 277 + priv = kzalloc(sizeof(*priv), GFP_KERNEL); 278 + if (!priv) 279 + return -ENOMEM; 280 + 285 281 new_bus = mdiobus_alloc(); 286 282 if (NULL == new_bus) 287 - return -ENOMEM; 283 + goto err_free_priv; 288 284 289 285 new_bus->name = "Freescale PowerQUICC MII Bus", 290 286 new_bus->read = &fsl_pq_mdio_read, 291 287 new_bus->write = &fsl_pq_mdio_write, 292 288 new_bus->reset = &fsl_pq_mdio_reset, 289 + new_bus->priv = priv; 293 290 fsl_pq_mdio_bus_name(new_bus->id, np); 294 291 295 292 /* Set the PHY base address */ ··· 304 291 err = -ENOMEM; 305 292 goto err_free_bus; 306 293 } 294 + priv->map = map; 307 295 308 296 if (of_device_is_compatible(np, "fsl,gianfar-mdio") || 309 297 of_device_is_compatible(np, "fsl,gianfar-tbi") || ··· 312 298 of_device_is_compatible(np, "ucc_geth_phy")) 313 299 map -= offsetof(struct fsl_pq_mdio, miimcfg); 314 300 regs = map; 315 - 316 - new_bus->priv = (void __force *)regs; 301 + priv->regs = regs; 317 302 318 303 new_bus->irq = kcalloc(PHY_MAX_ADDR, sizeof(int), GFP_KERNEL); 319 304 ··· 405 392 err_free_irqs: 406 393 kfree(new_bus->irq); 407 394 err_unmap_regs: 408 - iounmap(regs); 395 + iounmap(priv->map); 409 396 err_free_bus: 410 397 kfree(new_bus); 411 - 398 + err_free_priv: 399 + kfree(priv); 412 400 return err; 413 401 } 414 402 ··· 418 404 { 419 405 struct device *device = &ofdev->dev; 420 406 struct mii_bus *bus = dev_get_drvdata(device); 407 + struct fsl_pq_mdio_priv *priv = bus->priv; 421 408 422 409 mdiobus_unregister(bus); 423 410 424 411 dev_set_drvdata(device, NULL); 425 412 426 - iounmap(fsl_pq_mdio_get_regs(bus)); 413 + iounmap(priv->map); 427 414 bus->priv = NULL; 428 415 mdiobus_free(bus); 416 + kfree(priv); 429 417 430 418 return 0; 431 419 }
+3 -1
drivers/net/hamradio/bpqether.c
··· 248 248 { 249 249 unsigned char *ptr; 250 250 struct bpqdev *bpq; 251 + struct net_device *orig_dev; 251 252 int size; 252 253 253 254 /* ··· 283 282 284 283 bpq = netdev_priv(dev); 285 284 285 + orig_dev = dev; 286 286 if ((dev = bpq_get_ether_dev(dev)) == NULL) { 287 - dev->stats.tx_dropped++; 287 + orig_dev->stats.tx_dropped++; 288 288 kfree_skb(skb); 289 289 return NETDEV_TX_OK; 290 290 }
+7 -2
drivers/net/ixgbe/ixgbe_main.c
··· 262 262 int reg_idx = tx_ring->reg_idx; 263 263 int dcb_i = adapter->ring_feature[RING_F_DCB].indices; 264 264 265 - if (adapter->hw.mac.type == ixgbe_mac_82598EB) { 265 + switch (adapter->hw.mac.type) { 266 + case ixgbe_mac_82598EB: 266 267 tc = reg_idx >> 2; 267 268 txoff = IXGBE_TFCS_TXOFF0; 268 - } else if (adapter->hw.mac.type == ixgbe_mac_82599EB) { 269 + break; 270 + case ixgbe_mac_82599EB: 269 271 tc = 0; 270 272 txoff = IXGBE_TFCS_TXOFF; 271 273 if (dcb_i == 8) { ··· 286 284 tc += (reg_idx - 96) >> 4; 287 285 } 288 286 } 287 + break; 288 + default: 289 + tc = 0; 289 290 } 290 291 txoff <<= tc; 291 292 }
+1 -1
drivers/net/ll_temac_main.c
··· 134 134 struct sk_buff *skb; 135 135 int i; 136 136 137 - lp->rx_skb = kzalloc(sizeof(struct sk_buff)*RX_BD_NUM, GFP_KERNEL); 137 + lp->rx_skb = kzalloc(sizeof(*lp->rx_skb) * RX_BD_NUM, GFP_KERNEL); 138 138 /* allocate the tx and rx ring buffer descriptors. */ 139 139 /* returns a virtual addres and a physical address. */ 140 140 lp->tx_bd_v = dma_alloc_coherent(ndev->dev.parent,
+4 -2
drivers/net/mv643xx_eth.c
··· 656 656 struct sk_buff *skb; 657 657 int rx; 658 658 struct rx_desc *rx_desc; 659 + int size; 659 660 660 661 skb = __skb_dequeue(&mp->rx_recycle); 661 662 if (skb == NULL) ··· 679 678 680 679 rx_desc = rxq->rx_desc_area + rx; 681 680 681 + size = skb->end - skb->data; 682 682 rx_desc->buf_ptr = dma_map_single(mp->dev->dev.parent, 683 - skb->data, mp->skb_size, 683 + skb->data, size, 684 684 DMA_FROM_DEVICE); 685 - rx_desc->buf_size = mp->skb_size; 685 + rx_desc->buf_size = size; 686 686 rxq->rx_skb[rx] = skb; 687 687 wmb(); 688 688 rx_desc->cmd_sts = BUFFER_OWNED_BY_DMA | RX_ENABLE_INTERRUPT;
+2 -2
drivers/net/netxen/netxen_nic.h
··· 53 53 54 54 #define _NETXEN_NIC_LINUX_MAJOR 4 55 55 #define _NETXEN_NIC_LINUX_MINOR 0 56 - #define _NETXEN_NIC_LINUX_SUBVERSION 65 57 - #define NETXEN_NIC_LINUX_VERSIONID "4.0.65" 56 + #define _NETXEN_NIC_LINUX_SUBVERSION 72 57 + #define NETXEN_NIC_LINUX_VERSIONID "4.0.72" 58 58 59 59 #define NETXEN_VERSION_CODE(a, b, c) (((a) << 24) + ((b) << 16) + (c)) 60 60 #define _major(v) (((v) >> 24) & 0xff)
+65 -124
drivers/net/netxen/netxen_nic_ethtool.c
··· 66 66 67 67 #define NETXEN_NIC_TEST_LEN ARRAY_SIZE(netxen_nic_gstrings_test) 68 68 69 - #define NETXEN_NIC_REGS_COUNT 42 69 + #define NETXEN_NIC_REGS_COUNT 30 70 70 #define NETXEN_NIC_REGS_LEN (NETXEN_NIC_REGS_COUNT * sizeof(__le32)) 71 71 #define NETXEN_MAX_EEPROM_LEN 1024 72 72 ··· 312 312 return NETXEN_NIC_REGS_LEN; 313 313 } 314 314 315 - struct netxen_niu_regs { 316 - __u32 reg[NETXEN_NIC_REGS_COUNT]; 317 - }; 318 - 319 - static struct netxen_niu_regs niu_registers[] = { 320 - { 321 - /* GB Mode */ 322 - { 323 - NETXEN_NIU_GB_SERDES_RESET, 324 - NETXEN_NIU_GB0_MII_MODE, 325 - NETXEN_NIU_GB1_MII_MODE, 326 - NETXEN_NIU_GB2_MII_MODE, 327 - NETXEN_NIU_GB3_MII_MODE, 328 - NETXEN_NIU_GB0_GMII_MODE, 329 - NETXEN_NIU_GB1_GMII_MODE, 330 - NETXEN_NIU_GB2_GMII_MODE, 331 - NETXEN_NIU_GB3_GMII_MODE, 332 - NETXEN_NIU_REMOTE_LOOPBACK, 333 - NETXEN_NIU_GB0_HALF_DUPLEX, 334 - NETXEN_NIU_GB1_HALF_DUPLEX, 335 - NETXEN_NIU_RESET_SYS_FIFOS, 336 - NETXEN_NIU_GB_CRC_DROP, 337 - NETXEN_NIU_GB_DROP_WRONGADDR, 338 - NETXEN_NIU_TEST_MUX_CTL, 339 - 340 - NETXEN_NIU_GB_MAC_CONFIG_0(0), 341 - NETXEN_NIU_GB_MAC_CONFIG_1(0), 342 - NETXEN_NIU_GB_HALF_DUPLEX_CTRL(0), 343 - NETXEN_NIU_GB_MAX_FRAME_SIZE(0), 344 - NETXEN_NIU_GB_TEST_REG(0), 345 - NETXEN_NIU_GB_MII_MGMT_CONFIG(0), 346 - NETXEN_NIU_GB_MII_MGMT_COMMAND(0), 347 - NETXEN_NIU_GB_MII_MGMT_ADDR(0), 348 - NETXEN_NIU_GB_MII_MGMT_CTRL(0), 349 - NETXEN_NIU_GB_MII_MGMT_STATUS(0), 350 - NETXEN_NIU_GB_MII_MGMT_INDICATE(0), 351 - NETXEN_NIU_GB_INTERFACE_CTRL(0), 352 - NETXEN_NIU_GB_INTERFACE_STATUS(0), 353 - NETXEN_NIU_GB_STATION_ADDR_0(0), 354 - NETXEN_NIU_GB_STATION_ADDR_1(0), 355 - -1, 356 - } 357 - }, 358 - { 359 - /* XG Mode */ 360 - { 361 - NETXEN_NIU_XG_SINGLE_TERM, 362 - NETXEN_NIU_XG_DRIVE_HI, 363 - NETXEN_NIU_XG_DRIVE_LO, 364 - NETXEN_NIU_XG_DTX, 365 - NETXEN_NIU_XG_DEQ, 366 - NETXEN_NIU_XG_WORD_ALIGN, 367 - NETXEN_NIU_XG_RESET, 368 - NETXEN_NIU_XG_POWER_DOWN, 369 - NETXEN_NIU_XG_RESET_PLL, 370 - NETXEN_NIU_XG_SERDES_LOOPBACK, 371 - NETXEN_NIU_XG_DO_BYTE_ALIGN, 372 - NETXEN_NIU_XG_TX_ENABLE, 373 - NETXEN_NIU_XG_RX_ENABLE, 374 - NETXEN_NIU_XG_STATUS, 375 - NETXEN_NIU_XG_PAUSE_THRESHOLD, 376 - NETXEN_NIU_XGE_CONFIG_0, 377 - NETXEN_NIU_XGE_CONFIG_1, 378 - NETXEN_NIU_XGE_IPG, 379 - NETXEN_NIU_XGE_STATION_ADDR_0_HI, 380 - NETXEN_NIU_XGE_STATION_ADDR_0_1, 381 - NETXEN_NIU_XGE_STATION_ADDR_1_LO, 382 - NETXEN_NIU_XGE_STATUS, 383 - NETXEN_NIU_XGE_MAX_FRAME_SIZE, 384 - NETXEN_NIU_XGE_PAUSE_FRAME_VALUE, 385 - NETXEN_NIU_XGE_TX_BYTE_CNT, 386 - NETXEN_NIU_XGE_TX_FRAME_CNT, 387 - NETXEN_NIU_XGE_RX_BYTE_CNT, 388 - NETXEN_NIU_XGE_RX_FRAME_CNT, 389 - NETXEN_NIU_XGE_AGGR_ERROR_CNT, 390 - NETXEN_NIU_XGE_MULTICAST_FRAME_CNT, 391 - NETXEN_NIU_XGE_UNICAST_FRAME_CNT, 392 - NETXEN_NIU_XGE_CRC_ERROR_CNT, 393 - NETXEN_NIU_XGE_OVERSIZE_FRAME_ERR, 394 - NETXEN_NIU_XGE_UNDERSIZE_FRAME_ERR, 395 - NETXEN_NIU_XGE_LOCAL_ERROR_CNT, 396 - NETXEN_NIU_XGE_REMOTE_ERROR_CNT, 397 - NETXEN_NIU_XGE_CONTROL_CHAR_CNT, 398 - NETXEN_NIU_XGE_PAUSE_FRAME_CNT, 399 - -1, 400 - } 401 - } 402 - }; 403 - 404 315 static void 405 316 netxen_nic_get_regs(struct net_device *dev, struct ethtool_regs *regs, void *p) 406 317 { 407 318 struct netxen_adapter *adapter = netdev_priv(dev); 408 - __u32 mode, *regs_buff = p; 409 - int i, window; 319 + struct netxen_recv_context *recv_ctx = &adapter->recv_ctx; 320 + struct nx_host_sds_ring *sds_ring; 321 + u32 *regs_buff = p; 322 + int ring, i = 0; 323 + int port = adapter->physical_port; 410 324 411 325 memset(p, 0, NETXEN_NIC_REGS_LEN); 326 + 412 327 regs->version = (1 << 24) | (adapter->ahw.revision_id << 16) | 413 328 (adapter->pdev)->device; 414 - /* which mode */ 415 - regs_buff[0] = NXRD32(adapter, NETXEN_NIU_MODE); 416 - mode = regs_buff[0]; 417 329 418 - /* Common registers to all the modes */ 419 - regs_buff[2] = NXRD32(adapter, NETXEN_NIU_STRAP_VALUE_SAVE_HIGHER); 420 - /* GB/XGB Mode */ 421 - mode = (mode / 2) - 1; 422 - window = 0; 423 - if (mode <= 1) { 424 - for (i = 3; niu_registers[mode].reg[i - 3] != -1; i++) { 425 - /* GB: port specific registers */ 426 - if (mode == 0 && i >= 19) 427 - window = adapter->physical_port * 428 - NETXEN_NIC_PORT_WINDOW; 330 + if (adapter->is_up != NETXEN_ADAPTER_UP_MAGIC) 331 + return; 429 332 430 - regs_buff[i] = NXRD32(adapter, 431 - niu_registers[mode].reg[i - 3] + window); 432 - } 333 + regs_buff[i++] = NXRD32(adapter, CRB_CMDPEG_STATE); 334 + regs_buff[i++] = NXRD32(adapter, CRB_RCVPEG_STATE); 335 + regs_buff[i++] = NXRD32(adapter, CRB_FW_CAPABILITIES_1); 336 + regs_buff[i++] = NXRDIO(adapter, adapter->crb_int_state_reg); 337 + regs_buff[i++] = NXRD32(adapter, NX_CRB_DEV_REF_COUNT); 338 + regs_buff[i++] = NXRD32(adapter, NX_CRB_DEV_STATE); 339 + regs_buff[i++] = NXRD32(adapter, NETXEN_PEG_ALIVE_COUNTER); 340 + regs_buff[i++] = NXRD32(adapter, NETXEN_PEG_HALT_STATUS1); 341 + regs_buff[i++] = NXRD32(adapter, NETXEN_PEG_HALT_STATUS2); 433 342 343 + regs_buff[i++] = NXRD32(adapter, NETXEN_CRB_PEG_NET_0+0x3c); 344 + regs_buff[i++] = NXRD32(adapter, NETXEN_CRB_PEG_NET_1+0x3c); 345 + regs_buff[i++] = NXRD32(adapter, NETXEN_CRB_PEG_NET_2+0x3c); 346 + regs_buff[i++] = NXRD32(adapter, NETXEN_CRB_PEG_NET_3+0x3c); 347 + 348 + if (NX_IS_REVISION_P3(adapter->ahw.revision_id)) { 349 + 350 + regs_buff[i++] = NXRD32(adapter, NETXEN_CRB_PEG_NET_4+0x3c); 351 + i += 2; 352 + 353 + regs_buff[i++] = NXRD32(adapter, CRB_XG_STATE_P3); 354 + regs_buff[i++] = le32_to_cpu(*(adapter->tx_ring->hw_consumer)); 355 + 356 + } else { 357 + i++; 358 + 359 + regs_buff[i++] = NXRD32(adapter, 360 + NETXEN_NIU_XGE_CONFIG_0+(0x10000*port)); 361 + regs_buff[i++] = NXRD32(adapter, 362 + NETXEN_NIU_XGE_CONFIG_1+(0x10000*port)); 363 + 364 + regs_buff[i++] = NXRD32(adapter, CRB_XG_STATE); 365 + regs_buff[i++] = NXRDIO(adapter, 366 + adapter->tx_ring->crb_cmd_consumer); 367 + } 368 + 369 + regs_buff[i++] = NXRDIO(adapter, adapter->tx_ring->crb_cmd_producer); 370 + 371 + regs_buff[i++] = NXRDIO(adapter, 372 + recv_ctx->rds_rings[0].crb_rcv_producer); 373 + regs_buff[i++] = NXRDIO(adapter, 374 + recv_ctx->rds_rings[1].crb_rcv_producer); 375 + 376 + regs_buff[i++] = adapter->max_sds_rings; 377 + 378 + for (ring = 0; ring < adapter->max_sds_rings; ring++) { 379 + sds_ring = &(recv_ctx->sds_rings[ring]); 380 + regs_buff[i++] = NXRDIO(adapter, 381 + sds_ring->crb_sts_consumer); 434 382 } 435 383 } 436 384 437 385 static u32 netxen_nic_test_link(struct net_device *dev) 438 386 { 439 387 struct netxen_adapter *adapter = netdev_priv(dev); 440 - __u32 status; 441 - int val; 388 + u32 val, port; 442 389 443 - /* read which mode */ 444 - if (adapter->ahw.port_type == NETXEN_NIC_GBE) { 445 - if (adapter->phy_read && 446 - adapter->phy_read(adapter, 447 - NETXEN_NIU_GB_MII_MGMT_ADDR_PHY_STATUS, 448 - &status) != 0) 449 - return -EIO; 450 - else { 451 - val = netxen_get_phy_link(status); 452 - return !val; 453 - } 454 - } else if (adapter->ahw.port_type == NETXEN_NIC_XGBE) { 390 + port = adapter->physical_port; 391 + if (NX_IS_REVISION_P3(adapter->ahw.revision_id)) { 392 + val = NXRD32(adapter, CRB_XG_STATE_P3); 393 + val = XG_LINK_STATE_P3(adapter->ahw.pci_func, val); 394 + return (val == XG_LINK_UP_P3) ? 0 : 1; 395 + } else { 455 396 val = NXRD32(adapter, CRB_XG_STATE); 397 + val = (val >> port*8) & 0xff; 456 398 return (val == XG_LINK_UP) ? 0 : 1; 457 399 } 458 - return -EIO; 459 400 } 460 401 461 402 static int
+4 -2
drivers/net/netxen/netxen_nic_hw.c
··· 345 345 void 346 346 netxen_pcie_sem_unlock(struct netxen_adapter *adapter, int sem) 347 347 { 348 - int val; 349 - val = NXRD32(adapter, NETXEN_PCIE_REG(PCIE_SEM_UNLOCK(sem))); 348 + NXRD32(adapter, NETXEN_PCIE_REG(PCIE_SEM_UNLOCK(sem))); 350 349 } 351 350 352 351 int netxen_niu_xg_init_port(struct netxen_adapter *adapter, int port) ··· 689 690 LIST_HEAD(del_list); 690 691 struct list_head *head; 691 692 nx_mac_list_t *cur; 693 + 694 + if (adapter->is_up != NETXEN_ADAPTER_UP_MAGIC) 695 + return; 692 696 693 697 list_splice_tail_init(&adapter->mac_list, &del_list); 694 698
+3 -1
drivers/net/netxen/netxen_nic_init.c
··· 184 184 185 185 tx_ring = adapter->tx_ring; 186 186 vfree(tx_ring->cmd_buf_arr); 187 + kfree(tx_ring); 188 + adapter->tx_ring = NULL; 187 189 } 188 190 189 191 int netxen_alloc_sw_resources(struct netxen_adapter *adapter) ··· 784 782 if (NXRD32(adapter, CRB_CMDPEG_STATE) == PHAN_INITIALIZE_FAILED) 785 783 return 1; 786 784 787 - old_count = count = NXRD32(adapter, NETXEN_PEG_ALIVE_COUNTER); 785 + old_count = NXRD32(adapter, NETXEN_PEG_ALIVE_COUNTER); 788 786 789 787 for (i = 0; i < 10; i++) { 790 788
+3 -7
drivers/net/netxen/netxen_nic_main.c
··· 340 340 if (!(first_boot & 0x4)) { 341 341 first_boot |= 0x4; 342 342 NXWR32(adapter, NETXEN_PCIE_REG(0x4), first_boot); 343 - first_boot = NXRD32(adapter, NETXEN_PCIE_REG(0x4)); 343 + NXRD32(adapter, NETXEN_PCIE_REG(0x4)); 344 344 } 345 345 346 346 /* This is the first boot after power up */ ··· 1898 1898 linkup = (val == XG_LINK_UP_P3); 1899 1899 } else { 1900 1900 val = NXRD32(adapter, CRB_XG_STATE); 1901 - if (adapter->ahw.port_type == NETXEN_NIC_GBE) 1902 - linkup = (val >> port) & 1; 1903 - else { 1904 - val = (val >> port*8) & 0xff; 1905 - linkup = (val == XG_LINK_UP); 1906 - } 1901 + val = (val >> port*8) & 0xff; 1902 + linkup = (val == XG_LINK_UP); 1907 1903 } 1908 1904 1909 1905 netxen_advert_link_change(adapter, linkup);
+1 -1
drivers/net/niu.c
··· 2844 2844 break; 2845 2845 udelay(1); 2846 2846 } 2847 - if (limit < 0) 2847 + if (limit <= 0) 2848 2848 return -ENODEV; 2849 2849 2850 2850 return 0;
-1
drivers/net/pcmcia/nmclan_cs.c
··· 1402 1402 for (i = 0; i < 8; i++) 1403 1403 printk(KERN_CONT " %02X", ladrf[i]); 1404 1404 printk(KERN_CONT "\n"); 1405 - } 1406 1405 #endif 1407 1406 } /* BuildLAF */ 1408 1407
+2 -2
drivers/net/pcmcia/pcnet_cs.c
··· 1741 1741 PCMCIA_MFC_DEVICE_CIS_PROD_ID4(0, "NSC MF LAN/Modem", 0x58fc6056, "cis/DP83903.cis"), 1742 1742 PCMCIA_MFC_DEVICE_CIS_MANF_CARD(0, 0x0175, 0x0000, "cis/DP83903.cis"), 1743 1743 PCMCIA_DEVICE_CIS_MANF_CARD(0xc00f, 0x0002, "cis/LA-PCM.cis"), 1744 - PCMCIA_DEVICE_CIS_PROD_ID12("KTI", "PE520 PLUS", 0xad180345, 0x9d58d392, "PE520.cis"), 1744 + PCMCIA_DEVICE_CIS_PROD_ID12("KTI", "PE520 PLUS", 0xad180345, 0x9d58d392, "cis/PE520.cis"), 1745 1745 PCMCIA_DEVICE_CIS_PROD_ID12("NDC", "Ethernet", 0x01c43ae1, 0x00b2e941, "cis/NE2K.cis"), 1746 1746 PCMCIA_DEVICE_CIS_PROD_ID12("PMX ", "PE-200", 0x34f3f1c8, 0x10b59f8c, "cis/PE-200.cis"), 1747 1747 PCMCIA_DEVICE_CIS_PROD_ID12("TAMARACK", "Ethernet", 0xcf434fba, 0x00b2e941, "cis/tamarack.cis"), ··· 1754 1754 MODULE_FIRMWARE("cis/PCMLM28.cis"); 1755 1755 MODULE_FIRMWARE("cis/DP83903.cis"); 1756 1756 MODULE_FIRMWARE("cis/LA-PCM.cis"); 1757 - MODULE_FIRMWARE("PE520.cis"); 1757 + MODULE_FIRMWARE("cis/PE520.cis"); 1758 1758 MODULE_FIRMWARE("cis/NE2K.cis"); 1759 1759 MODULE_FIRMWARE("cis/PE-200.cis"); 1760 1760 MODULE_FIRMWARE("cis/tamarack.cis");
+2 -2
drivers/net/phy/broadcom.c
··· 331 331 bool clk125en = true; 332 332 333 333 /* Abort if we are using an untested phy. */ 334 - if (BRCM_PHY_MODEL(phydev) != PHY_ID_BCM57780 || 335 - BRCM_PHY_MODEL(phydev) != PHY_ID_BCM50610 || 334 + if (BRCM_PHY_MODEL(phydev) != PHY_ID_BCM57780 && 335 + BRCM_PHY_MODEL(phydev) != PHY_ID_BCM50610 && 336 336 BRCM_PHY_MODEL(phydev) != PHY_ID_BCM50610M) 337 337 return; 338 338
+65 -9
drivers/net/phy/mdio_bus.c
··· 264 264 (phydev->phy_id & phydrv->phy_id_mask)); 265 265 } 266 266 267 + #ifdef CONFIG_PM 268 + 267 269 static bool mdio_bus_phy_may_suspend(struct phy_device *phydev) 268 270 { 269 271 struct device_driver *drv = phydev->dev.driver; ··· 297 295 return true; 298 296 } 299 297 300 - /* Suspend and resume. Copied from platform_suspend and 301 - * platform_resume 302 - */ 303 - static int mdio_bus_suspend(struct device * dev, pm_message_t state) 298 + static int mdio_bus_suspend(struct device *dev) 304 299 { 305 300 struct phy_driver *phydrv = to_phy_driver(dev->driver); 306 301 struct phy_device *phydev = to_phy_device(dev); 307 302 303 + /* 304 + * We must stop the state machine manually, otherwise it stops out of 305 + * control, possibly with the phydev->lock held. Upon resume, netdev 306 + * may call phy routines that try to grab the same lock, and that may 307 + * lead to a deadlock. 308 + */ 309 + if (phydev->attached_dev) 310 + phy_stop_machine(phydev); 311 + 308 312 if (!mdio_bus_phy_may_suspend(phydev)) 309 313 return 0; 314 + 310 315 return phydrv->suspend(phydev); 311 316 } 312 317 313 - static int mdio_bus_resume(struct device * dev) 318 + static int mdio_bus_resume(struct device *dev) 314 319 { 315 320 struct phy_driver *phydrv = to_phy_driver(dev->driver); 316 321 struct phy_device *phydev = to_phy_device(dev); 322 + int ret; 317 323 318 324 if (!mdio_bus_phy_may_suspend(phydev)) 319 - return 0; 320 - return phydrv->resume(phydev); 325 + goto no_resume; 326 + 327 + ret = phydrv->resume(phydev); 328 + if (ret < 0) 329 + return ret; 330 + 331 + no_resume: 332 + if (phydev->attached_dev) 333 + phy_start_machine(phydev, NULL); 334 + 335 + return 0; 321 336 } 337 + 338 + static int mdio_bus_restore(struct device *dev) 339 + { 340 + struct phy_device *phydev = to_phy_device(dev); 341 + struct net_device *netdev = phydev->attached_dev; 342 + int ret; 343 + 344 + if (!netdev) 345 + return 0; 346 + 347 + ret = phy_init_hw(phydev); 348 + if (ret < 0) 349 + return ret; 350 + 351 + /* The PHY needs to renegotiate. */ 352 + phydev->link = 0; 353 + phydev->state = PHY_UP; 354 + 355 + phy_start_machine(phydev, NULL); 356 + 357 + return 0; 358 + } 359 + 360 + static struct dev_pm_ops mdio_bus_pm_ops = { 361 + .suspend = mdio_bus_suspend, 362 + .resume = mdio_bus_resume, 363 + .freeze = mdio_bus_suspend, 364 + .thaw = mdio_bus_resume, 365 + .restore = mdio_bus_restore, 366 + }; 367 + 368 + #define MDIO_BUS_PM_OPS (&mdio_bus_pm_ops) 369 + 370 + #else 371 + 372 + #define MDIO_BUS_PM_OPS NULL 373 + 374 + #endif /* CONFIG_PM */ 322 375 323 376 struct bus_type mdio_bus_type = { 324 377 .name = "mdio_bus", 325 378 .match = mdio_bus_match, 326 - .suspend = mdio_bus_suspend, 327 - .resume = mdio_bus_resume, 379 + .pm = MDIO_BUS_PM_OPS, 328 380 }; 329 381 EXPORT_SYMBOL(mdio_bus_type); 330 382
+15 -15
drivers/net/phy/phy_device.c
··· 378 378 } 379 379 EXPORT_SYMBOL(phy_disconnect); 380 380 381 + int phy_init_hw(struct phy_device *phydev) 382 + { 383 + int ret; 384 + 385 + if (!phydev->drv || !phydev->drv->config_init) 386 + return 0; 387 + 388 + ret = phy_scan_fixups(phydev); 389 + if (ret < 0) 390 + return ret; 391 + 392 + return phydev->drv->config_init(phydev); 393 + } 394 + 381 395 /** 382 396 * phy_attach_direct - attach a network device to a given PHY device pointer 383 397 * @dev: network device to attach ··· 439 425 /* Do initial configuration here, now that 440 426 * we have certain key parameters 441 427 * (dev_flags and interface) */ 442 - if (phydev->drv->config_init) { 443 - int err; 444 - 445 - err = phy_scan_fixups(phydev); 446 - 447 - if (err < 0) 448 - return err; 449 - 450 - err = phydev->drv->config_init(phydev); 451 - 452 - if (err < 0) 453 - return err; 454 - } 455 - 456 - return 0; 428 + return phy_init_hw(phydev); 457 429 } 458 430 EXPORT_SYMBOL(phy_attach_direct); 459 431
+1 -1
drivers/net/rrunner.c
··· 1293 1293 1294 1294 printk("Error code 0x%x\n", readl(&regs->Fail1)); 1295 1295 1296 - index = (((readl(&regs->EvtPrd) >> 8) & 0xff ) - 1) % EVT_RING_ENTRIES; 1296 + index = (((readl(&regs->EvtPrd) >> 8) & 0xff) - 1) % TX_RING_ENTRIES; 1297 1297 cons = rrpriv->dirty_tx; 1298 1298 printk("TX ring index %i, TX consumer %i\n", 1299 1299 index, cons);
+1 -1
drivers/net/sh_eth.c
··· 110 110 mdelay(1); 111 111 cnt--; 112 112 } 113 - if (cnt < 0) 113 + if (cnt == 0) 114 114 printk(KERN_ERR "Device reset fail\n"); 115 115 116 116 /* Table Init */
+2 -1
drivers/net/sky2.c
··· 1844 1844 sky2->tx_cons = idx; 1845 1845 smp_mb(); 1846 1846 1847 - if (tx_avail(sky2) > MAX_SKB_TX_LE + 4) 1847 + /* Wake unless it's detached, and called e.g. from sky2_down() */ 1848 + if (tx_avail(sky2) > MAX_SKB_TX_LE + 4 && netif_device_present(dev)) 1848 1849 netif_wake_queue(dev); 1849 1850 } 1850 1851
+4
drivers/net/tulip/Kconfig
··· 101 101 102 102 If in doubt, say Y. 103 103 104 + config TULIP_DM910X 105 + def_bool y 106 + depends on TULIP && SPARC 107 + 104 108 config DE4X5 105 109 tristate "Generic DECchip & DIGITAL EtherWORKS PCI/EISA" 106 110 depends on PCI || EISA
+21
drivers/net/tulip/dmfe.c
··· 92 92 #include <asm/uaccess.h> 93 93 #include <asm/irq.h> 94 94 95 + #ifdef CONFIG_TULIP_DM910X 96 + #include <linux/of.h> 97 + #endif 98 + 95 99 96 100 /* Board/System/Debug information/definition ---------------- */ 97 101 #define PCI_DM9132_ID 0x91321282 /* Davicom DM9132 ID */ ··· 380 376 381 377 if (!printed_version++) 382 378 printk(version); 379 + 380 + /* 381 + * SPARC on-board DM910x chips should be handled by the main 382 + * tulip driver, except for early DM9100s. 383 + */ 384 + #ifdef CONFIG_TULIP_DM910X 385 + if ((ent->driver_data == PCI_DM9100_ID && pdev->revision >= 0x30) || 386 + ent->driver_data == PCI_DM9102_ID) { 387 + struct device_node *dp = pci_device_to_OF_node(pdev); 388 + 389 + if (dp && of_get_property(dp, "local-mac-address", NULL)) { 390 + printk(KERN_INFO DRV_NAME 391 + ": skipping on-board DM910x (use tulip)\n"); 392 + return -ENODEV; 393 + } 394 + } 395 + #endif 383 396 384 397 /* Init network device */ 385 398 dev = alloc_etherdev(sizeof(*db));
+25 -7
drivers/net/tulip/tulip_core.c
··· 196 196 | HAS_NWAY | HAS_PCI_MWI, tulip_timer, tulip_media_task }, 197 197 198 198 /* DM910X */ 199 + #ifdef CONFIG_TULIP_DM910X 199 200 { "Davicom DM9102/DM9102A", 128, 0x0001ebef, 200 201 HAS_MII | HAS_MEDIA_TABLE | CSR12_IN_SROM | HAS_ACPI, 201 202 tulip_timer, tulip_media_task }, 203 + #else 204 + { NULL }, 205 + #endif 202 206 203 207 /* RS7112 */ 204 208 { "Conexant LANfinity", 256, 0x0001ebef, ··· 232 228 { 0x1259, 0xa120, PCI_ANY_ID, PCI_ANY_ID, 0, 0, COMET }, 233 229 { 0x11F6, 0x9881, PCI_ANY_ID, PCI_ANY_ID, 0, 0, COMPEX9881 }, 234 230 { 0x8086, 0x0039, PCI_ANY_ID, PCI_ANY_ID, 0, 0, I21145 }, 231 + #ifdef CONFIG_TULIP_DM910X 235 232 { 0x1282, 0x9100, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DM910X }, 236 233 { 0x1282, 0x9102, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DM910X }, 234 + #endif 237 235 { 0x1113, 0x1216, PCI_ANY_ID, PCI_ANY_ID, 0, 0, COMET }, 238 236 { 0x1113, 0x1217, PCI_ANY_ID, PCI_ANY_ID, 0, 0, MX98715 }, 239 237 { 0x1113, 0x9511, PCI_ANY_ID, PCI_ANY_ID, 0, 0, COMET }, ··· 1305 1299 } 1306 1300 1307 1301 /* 1308 - * Early DM9100's need software CRC and the DMFE driver 1302 + * DM910x chips should be handled by the dmfe driver, except 1303 + * on-board chips on SPARC systems. Also, early DM9100s need 1304 + * software CRC which only the dmfe driver supports. 1309 1305 */ 1310 1306 1311 - if (pdev->vendor == 0x1282 && pdev->device == 0x9100) 1312 - { 1313 - /* Read Chip revision */ 1314 - if (pdev->revision < 0x30) 1315 - { 1316 - printk(KERN_ERR PFX "skipping early DM9100 with Crc bug (use dmfe)\n"); 1307 + #ifdef CONFIG_TULIP_DM910X 1308 + if (chip_idx == DM910X) { 1309 + struct device_node *dp; 1310 + 1311 + if (pdev->vendor == 0x1282 && pdev->device == 0x9100 && 1312 + pdev->revision < 0x30) { 1313 + printk(KERN_INFO PFX 1314 + "skipping early DM9100 with Crc bug (use dmfe)\n"); 1315 + return -ENODEV; 1316 + } 1317 + 1318 + dp = pci_device_to_OF_node(pdev); 1319 + if (!(dp && of_get_property(dp, "local-mac-address", NULL))) { 1320 + printk(KERN_INFO PFX 1321 + "skipping DM910x expansion card (use dmfe)\n"); 1317 1322 return -ENODEV; 1318 1323 } 1319 1324 } 1325 + #endif 1320 1326 1321 1327 /* 1322 1328 * Looks for early PCI chipsets where people report hangs
+2 -1
drivers/net/ucc_geth.c
··· 3607 3607 if (!netif_running(ndev)) 3608 3608 return 0; 3609 3609 3610 + netif_device_detach(ndev); 3610 3611 napi_disable(&ugeth->napi); 3611 3612 3612 3613 /* ··· 3666 3665 phy_start(ugeth->phydev); 3667 3666 3668 3667 napi_enable(&ugeth->napi); 3669 - netif_start_queue(ndev); 3668 + netif_device_attach(ndev); 3670 3669 3671 3670 return 0; 3672 3671 }
+7 -6
drivers/net/ucc_geth.h
··· 838 838 using the maximum is 839 839 easier */ 840 840 #define UCC_GETH_SEND_QUEUE_QUEUE_DESCRIPTOR_ALIGNMENT 32 841 - #define UCC_GETH_SCHEDULER_ALIGNMENT 4 /* This is a guess */ 841 + #define UCC_GETH_SCHEDULER_ALIGNMENT 8 /* This is a guess */ 842 842 #define UCC_GETH_TX_STATISTICS_ALIGNMENT 4 /* This is a guess */ 843 843 #define UCC_GETH_RX_STATISTICS_ALIGNMENT 4 /* This is a guess */ 844 844 #define UCC_GETH_RX_INTERRUPT_COALESCING_ALIGNMENT 64 845 845 #define UCC_GETH_RX_BD_QUEUES_ALIGNMENT 8 /* This is a guess */ 846 846 #define UCC_GETH_RX_PREFETCHED_BDS_ALIGNMENT 128 /* This is a guess */ 847 - #define UCC_GETH_RX_EXTENDED_FILTERING_GLOBAL_PARAMETERS_ALIGNMENT 4 /* This 847 + #define UCC_GETH_RX_EXTENDED_FILTERING_GLOBAL_PARAMETERS_ALIGNMENT 8 /* This 848 848 is a 849 849 guess 850 850 */ ··· 899 899 #define UCC_GETH_UTFS_INIT 512 /* Tx virtual FIFO size 900 900 */ 901 901 #define UCC_GETH_UTFET_INIT 256 /* 1/2 utfs */ 902 - #define UCC_GETH_UTFTT_INIT 128 902 + #define UCC_GETH_UTFTT_INIT 512 903 903 /* Gigabit Ethernet (1000 Mbps) */ 904 904 #define UCC_GETH_URFS_GIGA_INIT 4096/*2048*/ /* Rx virtual 905 905 FIFO size */ 906 906 #define UCC_GETH_URFET_GIGA_INIT 2048/*1024*/ /* 1/2 urfs */ 907 907 #define UCC_GETH_URFSET_GIGA_INIT 3072/*1536*/ /* 3/4 urfs */ 908 - #define UCC_GETH_UTFS_GIGA_INIT 8192/*2048*/ /* Tx virtual 908 + #define UCC_GETH_UTFS_GIGA_INIT 4096/*2048*/ /* Tx virtual 909 909 FIFO size */ 910 - #define UCC_GETH_UTFET_GIGA_INIT 4096/*1024*/ /* 1/2 utfs */ 911 - #define UCC_GETH_UTFTT_GIGA_INIT 0x400/*0x40*/ /* */ 910 + #define UCC_GETH_UTFET_GIGA_INIT 2048/*1024*/ /* 1/2 utfs */ 911 + #define UCC_GETH_UTFTT_GIGA_INIT 4096/*0x40*/ /* Tx virtual 912 + FIFO size */ 912 913 913 914 #define UCC_GETH_REMODER_INIT 0 /* bits that must be 914 915 set */
+77 -28
drivers/net/usb/hso.c
··· 286 286 u8 usb_gone; 287 287 struct work_struct async_get_intf; 288 288 struct work_struct async_put_intf; 289 + struct work_struct reset_device; 289 290 290 291 struct usb_device *usb; 291 292 struct usb_interface *interface; ··· 333 332 /* Helper functions */ 334 333 static int hso_mux_submit_intr_urb(struct hso_shared_int *mux_int, 335 334 struct usb_device *usb, gfp_t gfp); 336 - static void log_usb_status(int status, const char *function); 335 + static void handle_usb_error(int status, const char *function, 336 + struct hso_device *hso_dev); 337 337 static struct usb_endpoint_descriptor *hso_get_ep(struct usb_interface *intf, 338 338 int type, int dir); 339 339 static int hso_get_mux_ports(struct usb_interface *intf, unsigned char *ports); ··· 352 350 static int hso_put_activity(struct hso_device *hso_dev); 353 351 static int hso_get_activity(struct hso_device *hso_dev); 354 352 static void tiocmget_intr_callback(struct urb *urb); 353 + static void reset_device(struct work_struct *data); 355 354 /*****************************************************************************/ 356 355 /* Helping functions */ 357 356 /*****************************************************************************/ ··· 464 461 {USB_DEVICE(0x0af0, 0x7501)}, /* GTM 382 */ 465 462 {USB_DEVICE(0x0af0, 0x7601)}, /* GE40x */ 466 463 {USB_DEVICE(0x0af0, 0x7701)}, 464 + {USB_DEVICE(0x0af0, 0x7706)}, 467 465 {USB_DEVICE(0x0af0, 0x7801)}, 468 466 {USB_DEVICE(0x0af0, 0x7901)}, 467 + {USB_DEVICE(0x0af0, 0x7A01)}, 468 + {USB_DEVICE(0x0af0, 0x7A05)}, 469 469 {USB_DEVICE(0x0af0, 0x8200)}, 470 470 {USB_DEVICE(0x0af0, 0x8201)}, 471 + {USB_DEVICE(0x0af0, 0x8300)}, 472 + {USB_DEVICE(0x0af0, 0x8302)}, 473 + {USB_DEVICE(0x0af0, 0x8304)}, 474 + {USB_DEVICE(0x0af0, 0x8400)}, 471 475 {USB_DEVICE(0x0af0, 0xd035)}, 472 476 {USB_DEVICE(0x0af0, 0xd055)}, 473 477 {USB_DEVICE(0x0af0, 0xd155)}, ··· 483 473 {USB_DEVICE(0x0af0, 0xd157)}, 484 474 {USB_DEVICE(0x0af0, 0xd257)}, 485 475 {USB_DEVICE(0x0af0, 0xd357)}, 476 + {USB_DEVICE(0x0af0, 0xd058)}, 477 + {USB_DEVICE(0x0af0, 0xc100)}, 486 478 {} 487 479 }; 488 480 MODULE_DEVICE_TABLE(usb, hso_ids); ··· 667 655 spin_unlock_irqrestore(&serial_table_lock, flags); 668 656 } 669 657 670 - /* log a meaningful explanation of an USB status */ 671 - static void log_usb_status(int status, const char *function) 658 + static void handle_usb_error(int status, const char *function, 659 + struct hso_device *hso_dev) 672 660 { 673 661 char *explanation; 674 662 ··· 697 685 case -EMSGSIZE: 698 686 explanation = "internal error"; 699 687 break; 688 + case -EILSEQ: 689 + case -EPROTO: 690 + case -ETIME: 691 + case -ETIMEDOUT: 692 + explanation = "protocol error"; 693 + if (hso_dev) 694 + schedule_work(&hso_dev->reset_device); 695 + break; 700 696 default: 701 697 explanation = "unknown status"; 702 698 break; 703 699 } 700 + 701 + /* log a meaningful explanation of an USB status */ 704 702 D1("%s: received USB status - %s (%d)", function, explanation, status); 705 703 } 706 704 ··· 784 762 /* log status, but don't act on it, we don't need to resubmit anything 785 763 * anyhow */ 786 764 if (status) 787 - log_usb_status(status, __func__); 765 + handle_usb_error(status, __func__, odev->parent); 788 766 789 767 hso_put_activity(odev->parent); 790 768 ··· 828 806 result = usb_submit_urb(odev->mux_bulk_tx_urb, GFP_ATOMIC); 829 807 if (result) { 830 808 dev_warn(&odev->parent->interface->dev, 831 - "failed mux_bulk_tx_urb %d", result); 809 + "failed mux_bulk_tx_urb %d\n", result); 832 810 net->stats.tx_errors++; 833 811 netif_start_queue(net); 834 812 } else { ··· 1020 998 1021 999 /* is al ok? (Filip: Who's Al ?) */ 1022 1000 if (status) { 1023 - log_usb_status(status, __func__); 1001 + handle_usb_error(status, __func__, odev->parent); 1024 1002 return; 1025 1003 } 1026 1004 ··· 1041 1019 if (odev->parent->port_spec & HSO_INFO_CRC_BUG) { 1042 1020 u32 rest; 1043 1021 u8 crc_check[4] = { 0xDE, 0xAD, 0xBE, 0xEF }; 1044 - rest = urb->actual_length % odev->in_endp->wMaxPacketSize; 1022 + rest = urb->actual_length % 1023 + le16_to_cpu(odev->in_endp->wMaxPacketSize); 1045 1024 if (((rest == 5) || (rest == 6)) && 1046 1025 !memcmp(((u8 *) urb->transfer_buffer) + 1047 1026 urb->actual_length - 4, crc_check, 4)) { ··· 1076 1053 result = usb_submit_urb(urb, GFP_ATOMIC); 1077 1054 if (result) 1078 1055 dev_warn(&odev->parent->interface->dev, 1079 - "%s failed submit mux_bulk_rx_urb %d", __func__, 1056 + "%s failed submit mux_bulk_rx_urb %d\n", __func__, 1080 1057 result); 1081 1058 } 1082 1059 ··· 1230 1207 D1("serial == NULL"); 1231 1208 return; 1232 1209 } else if (status) { 1233 - log_usb_status(status, __func__); 1210 + handle_usb_error(status, __func__, serial->parent); 1234 1211 return; 1235 1212 } 1236 1213 ··· 1248 1225 u8 crc_check[4] = { 0xDE, 0xAD, 0xBE, 0xEF }; 1249 1226 rest = 1250 1227 urb->actual_length % 1251 - serial->in_endp->wMaxPacketSize; 1228 + le16_to_cpu(serial->in_endp->wMaxPacketSize); 1252 1229 if (((rest == 5) || (rest == 6)) && 1253 1230 !memcmp(((u8 *) urb->transfer_buffer) + 1254 1231 urb->actual_length - 4, crc_check, 4)) { ··· 1536 1513 if (!serial) 1537 1514 return; 1538 1515 if (status) { 1539 - log_usb_status(status, __func__); 1516 + handle_usb_error(status, __func__, serial->parent); 1540 1517 return; 1541 1518 } 1542 1519 tiocmget = serial->tiocmget; ··· 1723 1700 D1("no tty structures"); 1724 1701 return -EINVAL; 1725 1702 } 1703 + 1704 + if ((serial->parent->port_spec & HSO_PORT_MASK) != HSO_PORT_MODEM) 1705 + return -EINVAL; 1706 + 1726 1707 if_num = serial->parent->interface->altsetting->desc.bInterfaceNumber; 1727 1708 1728 1709 spin_lock_irqsave(&serial->serial_lock, flags); ··· 1865 1838 result = usb_submit_urb(ctrl_urb, GFP_ATOMIC); 1866 1839 if (result) { 1867 1840 dev_err(&ctrl_urb->dev->dev, 1868 - "%s failed submit ctrl_urb %d type %d", __func__, 1841 + "%s failed submit ctrl_urb %d type %d\n", __func__, 1869 1842 result, type); 1870 1843 return result; 1871 1844 } ··· 1915 1888 1916 1889 /* status check */ 1917 1890 if (status) { 1918 - log_usb_status(status, __func__); 1891 + handle_usb_error(status, __func__, NULL); 1919 1892 return; 1920 1893 } 1921 1894 D4("\n--- Got intr callback 0x%02X ---", status); ··· 1932 1905 if (serial != NULL) { 1933 1906 D1("Pending read interrupt on port %d\n", i); 1934 1907 spin_lock(&serial->serial_lock); 1935 - if (serial->rx_state == RX_IDLE) { 1908 + if (serial->rx_state == RX_IDLE && 1909 + serial->open_count > 0) { 1936 1910 /* Setup and send a ctrl req read on 1937 1911 * port i */ 1938 - if (!serial->rx_urb_filled[0]) { 1912 + if (!serial->rx_urb_filled[0]) { 1939 1913 serial->rx_state = RX_SENT; 1940 1914 hso_mux_serial_read(serial); 1941 1915 } else 1942 1916 serial->rx_state = RX_PENDING; 1943 - 1944 1917 } else { 1945 - D1("Already pending a read on " 1946 - "port %d\n", i); 1918 + D1("Already a read pending on " 1919 + "port %d or port not open\n", i); 1947 1920 } 1948 1921 spin_unlock(&serial->serial_lock); 1949 1922 } ··· 1985 1958 tty = tty_kref_get(serial->tty); 1986 1959 spin_unlock(&serial->serial_lock); 1987 1960 if (status) { 1988 - log_usb_status(status, __func__); 1961 + handle_usb_error(status, __func__, serial->parent); 1989 1962 tty_kref_put(tty); 1990 1963 return; 1991 1964 } ··· 2041 2014 tty = tty_kref_get(serial->tty); 2042 2015 spin_unlock(&serial->serial_lock); 2043 2016 if (status) { 2044 - log_usb_status(status, __func__); 2017 + handle_usb_error(status, __func__, serial->parent); 2045 2018 tty_kref_put(tty); 2046 2019 return; 2047 2020 } ··· 2385 2358 serial->tx_data_length = tx_size; 2386 2359 serial->tx_data = kzalloc(serial->tx_data_length, GFP_KERNEL); 2387 2360 if (!serial->tx_data) { 2388 - dev_err(dev, "%s - Out of memory", __func__); 2361 + dev_err(dev, "%s - Out of memory\n", __func__); 2389 2362 goto exit; 2390 2363 } 2391 2364 serial->tx_buffer = kzalloc(serial->tx_data_length, GFP_KERNEL); 2392 2365 if (!serial->tx_buffer) { 2393 - dev_err(dev, "%s - Out of memory", __func__); 2366 + dev_err(dev, "%s - Out of memory\n", __func__); 2394 2367 goto exit; 2395 2368 } 2396 2369 ··· 2418 2391 2419 2392 INIT_WORK(&hso_dev->async_get_intf, async_get_intf); 2420 2393 INIT_WORK(&hso_dev->async_put_intf, async_put_intf); 2394 + INIT_WORK(&hso_dev->reset_device, reset_device); 2421 2395 2422 2396 return hso_dev; 2423 2397 } ··· 2859 2831 2860 2832 mux->shared_intr_urb = usb_alloc_urb(0, GFP_KERNEL); 2861 2833 if (!mux->shared_intr_urb) { 2862 - dev_err(&interface->dev, "Could not allocate intr urb?"); 2834 + dev_err(&interface->dev, "Could not allocate intr urb?\n"); 2863 2835 goto exit; 2864 2836 } 2865 - mux->shared_intr_buf = kzalloc(mux->intr_endp->wMaxPacketSize, 2866 - GFP_KERNEL); 2837 + mux->shared_intr_buf = 2838 + kzalloc(le16_to_cpu(mux->intr_endp->wMaxPacketSize), 2839 + GFP_KERNEL); 2867 2840 if (!mux->shared_intr_buf) { 2868 - dev_err(&interface->dev, "Could not allocate intr buf?"); 2841 + dev_err(&interface->dev, "Could not allocate intr buf?\n"); 2869 2842 goto exit; 2870 2843 } 2871 2844 ··· 3161 3132 return result; 3162 3133 } 3163 3134 3135 + static void reset_device(struct work_struct *data) 3136 + { 3137 + struct hso_device *hso_dev = 3138 + container_of(data, struct hso_device, reset_device); 3139 + struct usb_device *usb = hso_dev->usb; 3140 + int result; 3141 + 3142 + if (hso_dev->usb_gone) { 3143 + D1("No reset during disconnect\n"); 3144 + } else { 3145 + result = usb_lock_device_for_reset(usb, hso_dev->interface); 3146 + if (result < 0) 3147 + D1("unable to lock device for reset: %d\n", result); 3148 + else { 3149 + usb_reset_device(usb); 3150 + usb_unlock_device(usb); 3151 + } 3152 + } 3153 + } 3154 + 3164 3155 static void hso_serial_ref_free(struct kref *ref) 3165 3156 { 3166 3157 struct hso_device *hso_dev = container_of(ref, struct hso_device, ref); ··· 3281 3232 usb_rcvintpipe(usb, 3282 3233 shared_int->intr_endp->bEndpointAddress & 0x7F), 3283 3234 shared_int->shared_intr_buf, 3284 - shared_int->intr_endp->wMaxPacketSize, 3235 + 1, 3285 3236 intr_callback, shared_int, 3286 3237 shared_int->intr_endp->bInterval); 3287 3238 3288 3239 result = usb_submit_urb(shared_int->shared_intr_urb, gfp); 3289 3240 if (result) 3290 - dev_warn(&usb->dev, "%s failed mux_intr_urb %d", __func__, 3241 + dev_warn(&usb->dev, "%s failed mux_intr_urb %d\n", __func__, 3291 3242 result); 3292 3243 3293 3244 return result;
+2 -2
drivers/net/usb/rtl8150.c
··· 270 270 get_registers(dev, PHYCNT, 1, data); 271 271 } while ((data[0] & PHY_GO) && (i++ < MII_TIMEOUT)); 272 272 273 - if (i < MII_TIMEOUT) { 273 + if (i <= MII_TIMEOUT) { 274 274 get_registers(dev, PHYDAT, 2, data); 275 275 *reg = data[0] | (data[1] << 8); 276 276 return 0; ··· 295 295 get_registers(dev, PHYCNT, 1, data); 296 296 } while ((data[0] & PHY_GO) && (i++ < MII_TIMEOUT)); 297 297 298 - if (i < MII_TIMEOUT) 298 + if (i <= MII_TIMEOUT) 299 299 return 0; 300 300 else 301 301 return 1;
+4 -4
drivers/net/via-velocity.c
··· 2237 2237 /* Ensure chip is running */ 2238 2238 pci_set_power_state(vptr->pdev, PCI_D0); 2239 2239 2240 - velocity_give_many_rx_descs(vptr); 2241 - 2242 2240 velocity_init_registers(vptr, VELOCITY_INIT_COLD); 2243 2241 2244 2242 ret = request_irq(vptr->pdev->irq, velocity_intr, IRQF_SHARED, ··· 2247 2249 velocity_free_rings(vptr); 2248 2250 goto out; 2249 2251 } 2252 + 2253 + velocity_give_many_rx_descs(vptr); 2250 2254 2251 2255 mac_enable_int(vptr->mac_regs); 2252 2256 netif_start_queue(dev); ··· 2339 2339 2340 2340 dev->mtu = new_mtu; 2341 2341 2342 - velocity_give_many_rx_descs(vptr); 2343 - 2344 2342 velocity_init_registers(vptr, VELOCITY_INIT_COLD); 2343 + 2344 + velocity_give_many_rx_descs(vptr); 2345 2345 2346 2346 mac_enable_int(vptr->mac_regs); 2347 2347 netif_start_queue(dev);
+1 -1
drivers/net/vxge/vxge-main.c
··· 310 310 dma_addr = pci_map_single(ring->pdev, rx_priv->skb_data, 311 311 rx_priv->data_size, PCI_DMA_FROMDEVICE); 312 312 313 - if (dma_addr == 0) { 313 + if (unlikely(pci_dma_mapping_error(ring->pdev, dma_addr))) { 314 314 ring->stats.pci_map_fail++; 315 315 return -EIO; 316 316 }
+1 -1
drivers/s390/net/claw.c
··· 3398 3398 goto out_err; 3399 3399 } 3400 3400 CLAW_DBF_TEXT(2, setup, "init_mod"); 3401 - claw_root_dev = root_device_register("qeth"); 3401 + claw_root_dev = root_device_register("claw"); 3402 3402 ret = IS_ERR(claw_root_dev) ? PTR_ERR(claw_root_dev) : 0; 3403 3403 if (ret) 3404 3404 goto register_err;
+14 -1
drivers/serial/serial_cs.c
··· 819 819 PCMCIA_MFC_DEVICE_CIS_MANF_CARD(1, 0x0101, 0x0035, "cis/3CXEM556.cis"), 820 820 PCMCIA_MFC_DEVICE_CIS_MANF_CARD(1, 0x0101, 0x003d, "cis/3CXEM556.cis"), 821 821 PCMCIA_DEVICE_CIS_PROD_ID12("Sierra Wireless", "AC850", 0xd85f6206, 0x42a2c018, "cis/SW_8xx_SER.cis"), /* Sierra Wireless AC850 3G Network Adapter R1 */ 822 + PCMCIA_DEVICE_CIS_PROD_ID12("Sierra Wireless", "AC860", 0xd85f6206, 0x698f93db, "cis/SW_8xx_SER.cis"), /* Sierra Wireless AC860 3G Network Adapter R1 */ 822 823 PCMCIA_DEVICE_CIS_PROD_ID12("Sierra Wireless", "AC710/AC750", 0xd85f6206, 0x761b11e0, "cis/SW_7xx_SER.cis"), /* Sierra Wireless AC710/AC750 GPRS Network Adapter R1 */ 823 824 PCMCIA_DEVICE_CIS_MANF_CARD(0x0192, 0xa555, "cis/SW_555_SER.cis"), /* Sierra Aircard 555 CDMA 1xrtt Modem -- pre update */ 824 825 PCMCIA_DEVICE_CIS_MANF_CARD(0x013f, 0xa555, "cis/SW_555_SER.cis"), /* Sierra Aircard 555 CDMA 1xrtt Modem -- post update */ ··· 828 827 PCMCIA_DEVICE_CIS_PROD_ID12("ADVANTECH", "COMpad-32/85B-4", 0x96913a85, 0xcec8f102, "cis/COMpad4.cis"), 829 828 PCMCIA_DEVICE_CIS_PROD_ID123("ADVANTECH", "COMpad-32/85", "1.0", 0x96913a85, 0x8fbe92ae, 0x0877b627, "cis/COMpad2.cis"), 830 829 PCMCIA_DEVICE_CIS_PROD_ID2("RS-COM 2P", 0xad20b156, "cis/RS-COM-2P.cis"), 831 - PCMCIA_DEVICE_CIS_MANF_CARD(0x0013, 0x0000, "GLOBETROTTER.cis"), 830 + PCMCIA_DEVICE_CIS_MANF_CARD(0x0013, 0x0000, "cis/GLOBETROTTER.cis"), 832 831 PCMCIA_DEVICE_PROD_ID12("ELAN DIGITAL SYSTEMS LTD, c1997.","SERIAL CARD: SL100 1.00.",0x19ca78af,0xf964f42b), 833 832 PCMCIA_DEVICE_PROD_ID12("ELAN DIGITAL SYSTEMS LTD, c1997.","SERIAL CARD: SL100",0x19ca78af,0x71d98e83), 834 833 PCMCIA_DEVICE_PROD_ID12("ELAN DIGITAL SYSTEMS LTD, c1997.","SERIAL CARD: SL232 1.00.",0x19ca78af,0x69fb7490), ··· 861 860 PCMCIA_DEVICE_NULL, 862 861 }; 863 862 MODULE_DEVICE_TABLE(pcmcia, serial_ids); 863 + 864 + MODULE_FIRMWARE("cis/PCMLM28.cis"); 865 + MODULE_FIRMWARE("cis/DP83903.cis"); 866 + MODULE_FIRMWARE("cis/3CCFEM556.cis"); 867 + MODULE_FIRMWARE("cis/3CXEM556.cis"); 868 + MODULE_FIRMWARE("cis/SW_8xx_SER.cis"); 869 + MODULE_FIRMWARE("cis/SW_7xx_SER.cis"); 870 + MODULE_FIRMWARE("cis/SW_555_SER.cis"); 871 + MODULE_FIRMWARE("cis/MT5634ZLX.cis"); 872 + MODULE_FIRMWARE("cis/COMpad2.cis"); 873 + MODULE_FIRMWARE("cis/COMpad4.cis"); 874 + MODULE_FIRMWARE("cis/RS-COM-2P.cis"); 864 875 865 876 static struct pcmcia_driver serial_cs_driver = { 866 877 .owner = THIS_MODULE,
+2 -1
firmware/Makefile
··· 69 69 fw-shipped-$(CONFIG_MYRI_SBUS) += myricom/lanai.bin 70 70 fw-shipped-$(CONFIG_PCMCIA_PCNET) += cis/LA-PCM.cis cis/PCMLM28.cis \ 71 71 cis/DP83903.cis cis/NE2K.cis \ 72 - cis/tamarack.cis cis/PE-200.cis 72 + cis/tamarack.cis cis/PE-200.cis \ 73 + cis/PE520.cis 73 74 fw-shipped-$(CONFIG_PCMCIA_3C589) += cis/3CXEM556.cis 74 75 fw-shipped-$(CONFIG_PCMCIA_3C574) += cis/3CCFEM556.cis 75 76 fw-shipped-$(CONFIG_SERIAL_8250_CS) += cis/MT5634ZLX.cis cis/RS-COM-2P.cis \
+1
firmware/WHENCE
··· 601 601 cis/NE2K.cis 602 602 cis/tamarack.cis 603 603 cis/PE-200.cis 604 + cis/PE520.cis 604 605 605 606 Licence: GPL 606 607
+9
firmware/cis/PE520.cis.ihex
··· 1 + :1000000001030000FF152304014B544900504535FE 2 + :10001000323020504C55530050434D434941204508 3 + :10002000746865726E65740000FF20046101100041 4 + :10003000210206001A050101D00F0B1B09C101198D 5 + :0A00400001556530FFFF1400FF00BA 6 + :00000001FF 7 + # 8 + # Replacement CIS for PE520 ethernet card 9 + #
+1
include/linux/phy.h
··· 447 447 int phy_device_register(struct phy_device *phy); 448 448 int phy_clear_interrupt(struct phy_device *phydev); 449 449 int phy_config_interrupt(struct phy_device *phydev, u32 interrupts); 450 + int phy_init_hw(struct phy_device *phydev); 450 451 int phy_attach_direct(struct net_device *dev, struct phy_device *phydev, 451 452 u32 flags, phy_interface_t interface); 452 453 struct phy_device * phy_attach(struct net_device *dev,
+16
include/net/ip.h
··· 326 326 327 327 #endif 328 328 329 + static inline int sk_mc_loop(struct sock *sk) 330 + { 331 + if (!sk) 332 + return 1; 333 + switch (sk->sk_family) { 334 + case AF_INET: 335 + return inet_sk(sk)->mc_loop; 336 + #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) 337 + case AF_INET6: 338 + return inet6_sk(sk)->mc_loop; 339 + #endif 340 + } 341 + __WARN(); 342 + return 1; 343 + } 344 + 329 345 extern int ip_call_ra_chain(struct sk_buff *skb); 330 346 331 347 /*
+6
net/bridge/netfilter/ebtables.c
··· 1406 1406 { 1407 1407 int ret; 1408 1408 1409 + if (!capable(CAP_NET_ADMIN)) 1410 + return -EPERM; 1411 + 1409 1412 switch(cmd) { 1410 1413 case EBT_SO_SET_ENTRIES: 1411 1414 ret = do_replace(sock_net(sk), user, len); ··· 1427 1424 int ret; 1428 1425 struct ebt_replace tmp; 1429 1426 struct ebt_table *t; 1427 + 1428 + if (!capable(CAP_NET_ADMIN)) 1429 + return -EPERM; 1430 1430 1431 1431 if (copy_from_user(&tmp, user, sizeof(tmp))) 1432 1432 return -EFAULT;
+4
net/core/sock.c
··· 1205 1205 1206 1206 if (newsk->sk_prot->sockets_allocated) 1207 1207 percpu_counter_inc(newsk->sk_prot->sockets_allocated); 1208 + 1209 + if (sock_flag(newsk, SOCK_TIMESTAMP) || 1210 + sock_flag(newsk, SOCK_TIMESTAMPING_RX_SOFTWARE)) 1211 + net_enable_timestamp(); 1208 1212 } 1209 1213 out: 1210 1214 return newsk;
+1 -1
net/ipv4/ip_output.c
··· 254 254 */ 255 255 256 256 if (rt->rt_flags&RTCF_MULTICAST) { 257 - if ((!sk || inet_sk(sk)->mc_loop) 257 + if (sk_mc_loop(sk) 258 258 #ifdef CONFIG_IP_MROUTE 259 259 /* Small optimization: do not loopback not local frames, 260 260 which returned after forwarding; they will be dropped
+1 -2
net/ipv6/ip6_output.c
··· 121 121 skb->dev = dev; 122 122 123 123 if (ipv6_addr_is_multicast(&ipv6_hdr(skb)->daddr)) { 124 - struct ipv6_pinfo* np = skb->sk ? inet6_sk(skb->sk) : NULL; 125 124 struct inet6_dev *idev = ip6_dst_idev(skb_dst(skb)); 126 125 127 - if (!(dev->flags & IFF_LOOPBACK) && (!np || np->mc_loop) && 126 + if (!(dev->flags & IFF_LOOPBACK) && sk_mc_loop(skb->sk) && 128 127 ((mroute6_socket(dev_net(dev)) && 129 128 !(IP6CB(skb)->flags & IP6SKB_FORWARDED)) || 130 129 ipv6_chk_mcast_addr(dev, &ipv6_hdr(skb)->daddr,
+2 -1
net/netfilter/ipvs/Kconfig
··· 112 112 module, choose M here. If unsure, say N. 113 113 114 114 config IP_VS_WRR 115 - tristate "weighted round-robin scheduling" 115 + tristate "weighted round-robin scheduling" 116 + select GCD 116 117 ---help--- 117 118 The weighted robin-robin scheduling algorithm directs network 118 119 connections to different real servers based on server weights
+13 -1
net/netfilter/ipvs/ip_vs_ctl.c
··· 2077 2077 if (!capable(CAP_NET_ADMIN)) 2078 2078 return -EPERM; 2079 2079 2080 + if (cmd < IP_VS_BASE_CTL || cmd > IP_VS_SO_SET_MAX) 2081 + return -EINVAL; 2082 + if (len < 0 || len > MAX_ARG_LEN) 2083 + return -EINVAL; 2080 2084 if (len != set_arglen[SET_CMDID(cmd)]) { 2081 2085 pr_err("set_ctl: len %u != %u\n", 2082 2086 len, set_arglen[SET_CMDID(cmd)]); ··· 2356 2352 { 2357 2353 unsigned char arg[128]; 2358 2354 int ret = 0; 2355 + unsigned int copylen; 2359 2356 2360 2357 if (!capable(CAP_NET_ADMIN)) 2361 2358 return -EPERM; 2359 + 2360 + if (cmd < IP_VS_BASE_CTL || cmd > IP_VS_SO_GET_MAX) 2361 + return -EINVAL; 2362 2362 2363 2363 if (*len < get_arglen[GET_CMDID(cmd)]) { 2364 2364 pr_err("get_ctl: len %u < %u\n", ··· 2370 2362 return -EINVAL; 2371 2363 } 2372 2364 2373 - if (copy_from_user(arg, user, get_arglen[GET_CMDID(cmd)]) != 0) 2365 + copylen = get_arglen[GET_CMDID(cmd)]; 2366 + if (copylen > 128) 2367 + return -EINVAL; 2368 + 2369 + if (copy_from_user(arg, user, copylen) != 0) 2374 2370 return -EFAULT; 2375 2371 2376 2372 if (mutex_lock_interruptible(&__ip_vs_mutex))
+1 -14
net/netfilter/ipvs/ip_vs_wrr.c
··· 24 24 #include <linux/module.h> 25 25 #include <linux/kernel.h> 26 26 #include <linux/net.h> 27 + #include <linux/gcd.h> 27 28 28 29 #include <net/ip_vs.h> 29 30 ··· 38 37 int di; /* decreasing interval */ 39 38 }; 40 39 41 - 42 - /* 43 - * Get the gcd of server weights 44 - */ 45 - static int gcd(int a, int b) 46 - { 47 - int c; 48 - 49 - while ((c = a % b)) { 50 - a = b; 51 - b = c; 52 - } 53 - return b; 54 - } 55 40 56 41 static int ip_vs_wrr_gcd_weight(struct ip_vs_service *svc) 57 42 {
+9 -9
net/netfilter/nf_conntrack_ftp.c
··· 323 323 struct nf_ct_ftp_master *info, int dir, 324 324 struct sk_buff *skb) 325 325 { 326 - unsigned int i, oldest = NUM_SEQ_TO_REMEMBER; 326 + unsigned int i, oldest; 327 327 328 328 /* Look for oldest: if we find exact match, we're done. */ 329 329 for (i = 0; i < info->seq_aft_nl_num[dir]; i++) { 330 330 if (info->seq_aft_nl[dir][i] == nl_seq) 331 331 return; 332 - 333 - if (oldest == info->seq_aft_nl_num[dir] || 334 - before(info->seq_aft_nl[dir][i], 335 - info->seq_aft_nl[dir][oldest])) 336 - oldest = i; 337 332 } 338 333 339 334 if (info->seq_aft_nl_num[dir] < NUM_SEQ_TO_REMEMBER) { 340 335 info->seq_aft_nl[dir][info->seq_aft_nl_num[dir]++] = nl_seq; 341 - } else if (oldest != NUM_SEQ_TO_REMEMBER && 342 - after(nl_seq, info->seq_aft_nl[dir][oldest])) { 343 - info->seq_aft_nl[dir][oldest] = nl_seq; 336 + } else { 337 + if (before(info->seq_aft_nl[dir][0], info->seq_aft_nl[dir][1])) 338 + oldest = 0; 339 + else 340 + oldest = 1; 341 + 342 + if (after(nl_seq, info->seq_aft_nl[dir][oldest])) 343 + info->seq_aft_nl[dir][oldest] = nl_seq; 344 344 } 345 345 } 346 346
+14 -5
net/packet/af_packet.c
··· 1021 1021 1022 1022 status = TP_STATUS_SEND_REQUEST; 1023 1023 err = dev_queue_xmit(skb); 1024 - if (unlikely(err > 0 && (err = net_xmit_errno(err)) != 0)) 1025 - goto out_xmit; 1024 + if (unlikely(err > 0)) { 1025 + err = net_xmit_errno(err); 1026 + if (err && __packet_get_status(po, ph) == 1027 + TP_STATUS_AVAILABLE) { 1028 + /* skb was destructed already */ 1029 + skb = NULL; 1030 + goto out_status; 1031 + } 1032 + /* 1033 + * skb was dropped but not destructed yet; 1034 + * let's treat it like congestion or err < 0 1035 + */ 1036 + err = 0; 1037 + } 1026 1038 packet_increment_head(&po->tx_ring); 1027 1039 len_sum += tp_len; 1028 1040 } while (likely((ph != NULL) || ··· 1045 1033 err = len_sum; 1046 1034 goto out_put; 1047 1035 1048 - out_xmit: 1049 - skb->destructor = sock_wfree; 1050 - atomic_dec(&po->tx_ring.pending); 1051 1036 out_status: 1052 1037 __packet_set_status(po, ph, status); 1053 1038 kfree_skb(skb);
+1 -1
net/rose/rose_loopback.c
··· 75 75 lci_i = ((skb->data[0] << 8) & 0xF00) + ((skb->data[1] << 0) & 0x0FF); 76 76 frametype = skb->data[2]; 77 77 dest = (rose_address *)(skb->data + 4); 78 - lci_o = 0xFFF - lci_i; 78 + lci_o = ROSE_DEFAULT_MAXVC + 1 - lci_i; 79 79 80 80 skb_reset_transport_header(skb); 81 81
+1 -2
net/sctp/socket.c
··· 2087 2087 if (copy_from_user(&sp->autoclose, optval, optlen)) 2088 2088 return -EFAULT; 2089 2089 /* make sure it won't exceed MAX_SCHEDULE_TIMEOUT */ 2090 - if (sp->autoclose > (MAX_SCHEDULE_TIMEOUT / HZ) ) 2091 - sp->autoclose = (__u32)(MAX_SCHEDULE_TIMEOUT / HZ) ; 2090 + sp->autoclose = min_t(long, sp->autoclose, MAX_SCHEDULE_TIMEOUT / HZ); 2092 2091 2093 2092 return 0; 2094 2093 }