···31523152hfcmulti_pcm(struct hfc_multi *hc, int ch, int slot_tx, int bank_tx,31533153 int slot_rx, int bank_rx)31543154{31553155- if (slot_rx < 0 || slot_rx < 0 || bank_tx < 0 || bank_rx < 0) {31553155+ if (slot_tx < 0 || slot_rx < 0 || bank_tx < 0 || bank_rx < 0) {31563156 /* disable PCM */31573157 mode_hfcmulti(hc, ch, hc->chan[ch].protocol, -1, 0, -1, 0);31583158 return;
+2-2
drivers/net/3c507.c
···5656#include <linux/errno.h>5757#include <linux/netdevice.h>5858#include <linux/etherdevice.h>5959+#include <linux/if_ether.h>5960#include <linux/skbuff.h>6061#include <linux/slab.h>6162#include <linux/init.h>···735734 memcpy_toio(lp->base, init_words + 5, sizeof(init_words) - 10);736735737736 /* Fill in the station address. */738738- memcpy_toio(lp->base+SA_OFFSET, dev->dev_addr,739739- sizeof(dev->dev_addr));737737+ memcpy_toio(lp->base+SA_OFFSET, dev->dev_addr, ETH_ALEN);740738741739 /* The Tx-block list is written as needed. We just set up the values. */742740 lp->tx_cmd_link = IDLELOOP + 4;
+1-1
drivers/net/atarilance.c
···663663 while (--i > 0)664664 if (DREG & CSR0_IDON)665665 break;666666- if (i < 0 || (DREG & CSR0_ERR)) {666666+ if (i <= 0 || (DREG & CSR0_ERR)) {667667 DPRINTK( 2, ( "lance_open(): opening %s failed, i=%d, csr0=%04x\n",668668 dev->name, i, DREG ));669669 DREG = CSR0_STOP;
+5-2
drivers/net/atlx/atl2.c
···19591959 return -ENOMEM;1960196019611961 for (i = first_dword; i < last_dword; i++) {19621962- if (!atl2_read_eeprom(hw, i*4, &(eeprom_buff[i-first_dword])))19631963- return -EIO;19621962+ if (!atl2_read_eeprom(hw, i*4, &(eeprom_buff[i-first_dword]))) {19631963+ ret_val = -EIO;19641964+ goto free;19651965+ }19641966 }1965196719661968 memcpy(bytes, (u8 *)eeprom_buff + (eeprom->offset & 3),19671969 eeprom->len);19701970+free:19681971 kfree(eeprom_buff);1969197219701973 return ret_val;
+1
drivers/net/benet/be.h
···275275 u32 tx_fc; /* Tx flow control */276276 int link_speed;277277 u8 port_type;278278+ u8 transceiver;278279};279280280281extern const struct ethtool_ops be_ethtool_ops;
···15801580 // check if any partner replys15811581 if (best->is_individual) {15821582 pr_warning("%s: Warning: No 802.3ad response from the link partner for any adapters in the bond\n",15831583- best->slave->dev->master->name);15831583+ best->slave ? best->slave->dev->master->name : "NULL");15841584 }1585158515861586 best->is_active = 1;
+1-1
drivers/net/can/mcp251x.c
···990990 goto error_tx_buf;991991 }992992 priv->spi_rx_buf = kmalloc(SPI_TRANSFER_BUF_LEN, GFP_KERNEL);993993- if (!priv->spi_tx_buf) {993993+ if (!priv->spi_rx_buf) {994994 ret = -ENOMEM;995995 goto error_rx_buf;996996 }
+1-2
drivers/net/cs89x0.c
···13251325 write_irq(dev, lp->chip_type, dev->irq);13261326 ret = request_irq(dev->irq, net_interrupt, 0, dev->name, dev);13271327 if (ret) {13281328- if (net_debug)13291329- printk(KERN_DEBUG "cs89x0: request_irq(%d) failed\n", dev->irq);13281328+ printk(KERN_ERR "cs89x0: request_irq(%d) failed\n", dev->irq);13301329 goto bad_out;13311330 }13321331 }
···237237 /* Set if manageability features are enabled. */238238 mac->arc_subsystem_valid = (er32(FWSM) & E1000_FWSM_MODE_MASK)239239 ? true : false;240240+ /* Adaptive IFS supported */241241+ mac->adaptive_ifs = true;240242241243 /* check for link */242244 switch (hw->phy.media_type) {
+2
drivers/net/e1000e/es2lan.c
···224224 /* Set if manageability features are enabled. */225225 mac->arc_subsystem_valid = (er32(FWSM) & E1000_FWSM_MODE_MASK)226226 ? true : false;227227+ /* Adaptive IFS not supported */228228+ mac->adaptive_ifs = false;227229228230 /* check for link */229231 switch (hw->phy.media_type) {
···8787#include <linux/module.h>8888#include <linux/netdevice.h>8989#include <linux/etherdevice.h>9090+#include <linux/if_ether.h>9091#include <linux/skbuff.h>9192#include <linux/bitops.h>9293···989988990989 /* copy out MAC address */991990992992- for (z = 0; z < sizeof(dev->dev_addr); z++)991991+ for (z = 0; z < ETH_ALEN; z++)993992 dev->dev_addr[z] = inb(dev->base_addr + MACADDRPROM + z);994993995994 /* print config */
+1-3
drivers/net/igb/e1000_82575.c
···10961096 hw_dbg("Configuring Autoneg:PCS_LCTL=0x%08X\n", reg);10971097 } else {10981098 /* Set PCS register for forced link */10991099- reg |= E1000_PCS_LCTL_FSD | /* Force Speed */11001100- E1000_PCS_LCTL_FORCE_LINK | /* Force Link */11011101- E1000_PCS_LCTL_FLV_LINK_UP; /* Force link value up */10991099+ reg |= E1000_PCS_LCTL_FSD; /* Force Speed */1102110011031101 hw_dbg("Configuring Forced Link:PCS_LCTL=0x%08X\n", reg);11041102 }
-9
drivers/net/igb/e1000_phy.c
···457457 phy_data |= I82580_CFG_ENABLE_DOWNSHIFT;458458459459 ret_val = phy->ops.write_reg(hw, I82580_CFG_REG, phy_data);460460- if (ret_val)461461- goto out;462462-463463- /* Set number of link attempts before downshift */464464- ret_val = phy->ops.read_reg(hw, I82580_CTRL_REG, &phy_data);465465- if (ret_val)466466- goto out;467467- phy_data &= ~I82580_CTRL_DOWNSHIFT_MASK;468468- ret_val = phy->ops.write_reg(hw, I82580_CTRL_REG, phy_data);469460470461out:471462 return ret_val;
+1-1
drivers/net/igb/igb_ethtool.c
···17951795 /* dual port cards only support WoL on port A from now on17961796 * unless it was enabled in the eeprom for port B17971797 * so exclude FUNC_1 ports from having WoL enabled */17981798- if (rd32(E1000_STATUS) & E1000_STATUS_FUNC_1 &&17981798+ if ((rd32(E1000_STATUS) & E1000_STATUS_FUNC_MASK) &&17991799 !adapter->eeprom_wol) {18001800 wol->supported = 0;18011801 break;
···27592759 err = hw->mac.ops.reset_hw(hw);27602760 if (err) {27612761 dev_info(&pdev->dev,27622762- "PF still in reset state, assigning new address\n");27622762+ "PF still in reset state, assigning new address."27632763+ " Is the PF interface up?\n");27632764 random_ether_addr(hw->mac.addr);27642765 } else {27652766 err = hw->mac.ops.read_mac_addr(hw);
+12-2
drivers/net/ixgbe/ixgbe_main.c
···305305 int reg_idx = tx_ring->reg_idx;306306 int dcb_i = adapter->ring_feature[RING_F_DCB].indices;307307308308- if (adapter->hw.mac.type == ixgbe_mac_82598EB) {308308+ switch (adapter->hw.mac.type) {309309+ case ixgbe_mac_82598EB:309310 tc = reg_idx >> 2;310311 txoff = IXGBE_TFCS_TXOFF0;311311- } else if (adapter->hw.mac.type == ixgbe_mac_82599EB) {312312+ break;313313+ case ixgbe_mac_82599EB:312314 tc = 0;313315 txoff = IXGBE_TFCS_TXOFF;314316 if (dcb_i == 8) {···329327 tc += (reg_idx - 96) >> 4;330328 }331329 }330330+ break;331331+ default:332332+ tc = 0;332333 }333334 txoff <<= tc;334335 }···4563455845644559 pci_set_power_state(pdev, PCI_D0);45654560 pci_restore_state(pdev);45614561+ /*45624562+ * pci_restore_state clears dev->state_saved so call45634563+ * pci_save_state to restore it.45644564+ */45654565+ pci_save_state(pdev);4566456645674567 err = pci_enable_device_mem(pdev);45684568 if (err) {
+1-1
drivers/net/ll_temac_main.c
···134134 struct sk_buff *skb;135135 int i;136136137137- lp->rx_skb = kzalloc(sizeof(struct sk_buff)*RX_BD_NUM, GFP_KERNEL);137137+ lp->rx_skb = kzalloc(sizeof(*lp->rx_skb) * RX_BD_NUM, GFP_KERNEL);138138 /* allocate the tx and rx ring buffer descriptors. */139139 /* returns a virtual addres and a physical address. */140140 lp->tx_bd_v = dma_alloc_coherent(ndev->dev.parent,
···4545#include <linux/crc32.h>4646#include <linux/netdevice.h>4747#include <linux/etherdevice.h>4848+#include <linux/if_ether.h>4849#include <linux/skbuff.h>4950#include <linux/spinlock.h>5051#include <linux/moduleparam.h>···1766176517671766 /* if the ethernet address is not valid, force to 00:00:00:00:00:00 */17681767 if (!is_valid_ether_addr(dev->perm_addr))17691769- memset(dev->dev_addr, 0, sizeof(dev->dev_addr));17681768+ memset(dev->dev_addr, 0, ETH_ALEN);1770176917711770 if (pcnet32_debug & NETIF_MSG_PROBE) {17721771 printk(" %pM", dev->dev_addr);
+2-2
drivers/net/phy/broadcom.c
···331331 bool clk125en = true;332332333333 /* Abort if we are using an untested phy. */334334- if (BRCM_PHY_MODEL(phydev) != PHY_ID_BCM57780 ||335335- BRCM_PHY_MODEL(phydev) != PHY_ID_BCM50610 ||334334+ if (BRCM_PHY_MODEL(phydev) != PHY_ID_BCM57780 &&335335+ BRCM_PHY_MODEL(phydev) != PHY_ID_BCM50610 &&336336 BRCM_PHY_MODEL(phydev) != PHY_ID_BCM50610M)337337 return;338338
+65-9
drivers/net/phy/mdio_bus.c
···264264 (phydev->phy_id & phydrv->phy_id_mask));265265}266266267267+#ifdef CONFIG_PM268268+267269static bool mdio_bus_phy_may_suspend(struct phy_device *phydev)268270{269271 struct device_driver *drv = phydev->dev.driver;···297295 return true;298296}299297300300-/* Suspend and resume. Copied from platform_suspend and301301- * platform_resume302302- */303303-static int mdio_bus_suspend(struct device * dev, pm_message_t state)298298+static int mdio_bus_suspend(struct device *dev)304299{305300 struct phy_driver *phydrv = to_phy_driver(dev->driver);306301 struct phy_device *phydev = to_phy_device(dev);307302303303+ /*304304+ * We must stop the state machine manually, otherwise it stops out of305305+ * control, possibly with the phydev->lock held. Upon resume, netdev306306+ * may call phy routines that try to grab the same lock, and that may307307+ * lead to a deadlock.308308+ */309309+ if (phydev->attached_dev)310310+ phy_stop_machine(phydev);311311+308312 if (!mdio_bus_phy_may_suspend(phydev))309313 return 0;314314+310315 return phydrv->suspend(phydev);311316}312317313313-static int mdio_bus_resume(struct device * dev)318318+static int mdio_bus_resume(struct device *dev)314319{315320 struct phy_driver *phydrv = to_phy_driver(dev->driver);316321 struct phy_device *phydev = to_phy_device(dev);322322+ int ret;317323318324 if (!mdio_bus_phy_may_suspend(phydev))319319- return 0;320320- return phydrv->resume(phydev);325325+ goto no_resume;326326+327327+ ret = phydrv->resume(phydev);328328+ if (ret < 0)329329+ return ret;330330+331331+no_resume:332332+ if (phydev->attached_dev)333333+ phy_start_machine(phydev, NULL);334334+335335+ return 0;321336}337337+338338+static int mdio_bus_restore(struct device *dev)339339+{340340+ struct phy_device *phydev = to_phy_device(dev);341341+ struct net_device *netdev = phydev->attached_dev;342342+ int ret;343343+344344+ if (!netdev)345345+ return 0;346346+347347+ ret = phy_init_hw(phydev);348348+ if (ret < 0)349349+ return ret;350350+351351+ /* The PHY needs to renegotiate. */352352+ phydev->link = 0;353353+ phydev->state = PHY_UP;354354+355355+ phy_start_machine(phydev, NULL);356356+357357+ return 0;358358+}359359+360360+static struct dev_pm_ops mdio_bus_pm_ops = {361361+ .suspend = mdio_bus_suspend,362362+ .resume = mdio_bus_resume,363363+ .freeze = mdio_bus_suspend,364364+ .thaw = mdio_bus_resume,365365+ .restore = mdio_bus_restore,366366+};367367+368368+#define MDIO_BUS_PM_OPS (&mdio_bus_pm_ops)369369+370370+#else371371+372372+#define MDIO_BUS_PM_OPS NULL373373+374374+#endif /* CONFIG_PM */322375323376struct bus_type mdio_bus_type = {324377 .name = "mdio_bus",325378 .match = mdio_bus_match,326326- .suspend = mdio_bus_suspend,327327- .resume = mdio_bus_resume,379379+ .pm = MDIO_BUS_PM_OPS,328380};329381EXPORT_SYMBOL(mdio_bus_type);330382
+15-15
drivers/net/phy/phy_device.c
···378378}379379EXPORT_SYMBOL(phy_disconnect);380380381381+int phy_init_hw(struct phy_device *phydev)382382+{383383+ int ret;384384+385385+ if (!phydev->drv || !phydev->drv->config_init)386386+ return 0;387387+388388+ ret = phy_scan_fixups(phydev);389389+ if (ret < 0)390390+ return ret;391391+392392+ return phydev->drv->config_init(phydev);393393+}394394+381395/**382396 * phy_attach_direct - attach a network device to a given PHY device pointer383397 * @dev: network device to attach···439425 /* Do initial configuration here, now that440426 * we have certain key parameters441427 * (dev_flags and interface) */442442- if (phydev->drv->config_init) {443443- int err;444444-445445- err = phy_scan_fixups(phydev);446446-447447- if (err < 0)448448- return err;449449-450450- err = phydev->drv->config_init(phydev);451451-452452- if (err < 0)453453- return err;454454- }455455-456456- return 0;428428+ return phy_init_hw(phydev);457429}458430EXPORT_SYMBOL(phy_attach_direct);459431
+1-1
drivers/net/rrunner.c
···1293129312941294 printk("Error code 0x%x\n", readl(®s->Fail1));1295129512961296- index = (((readl(®s->EvtPrd) >> 8) & 0xff ) - 1) % EVT_RING_ENTRIES;12961296+ index = (((readl(®s->EvtPrd) >> 8) & 0xff) - 1) % TX_RING_ENTRIES;12971297 cons = rrpriv->dirty_tx;12981298 printk("TX ring index %i, TX consumer %i\n",12991299 index, cons);
+3-3
drivers/net/sfc/efx.c
···741741742742 EFX_LOG(efx, "create port\n");743743744744+ if (phy_flash_cfg)745745+ efx->phy_mode = PHY_MODE_SPECIAL;746746+744747 /* Connect up MAC/PHY operations table */745748 rc = efx->type->probe_port(efx);746749 if (rc)747750 goto err;748748-749749- if (phy_flash_cfg)750750- efx->phy_mode = PHY_MODE_SPECIAL;751751752752 /* Sanity check MAC address */753753 if (is_valid_ether_addr(efx->mac_address)) {
···101101102102 If in doubt, say Y.103103104104+config TULIP_DM910X105105+ def_bool y106106+ depends on TULIP && SPARC107107+104108config DE4X5105109 tristate "Generic DECchip & DIGITAL EtherWORKS PCI/EISA"106110 depends on PCI || EISA
+21
drivers/net/tulip/dmfe.c
···9292#include <asm/uaccess.h>9393#include <asm/irq.h>94949595+#ifdef CONFIG_TULIP_DM910X9696+#include <linux/of.h>9797+#endif9898+959996100/* Board/System/Debug information/definition ---------------- */97101#define PCI_DM9132_ID 0x91321282 /* Davicom DM9132 ID */···380376381377 if (!printed_version++)382378 printk(version);379379+380380+ /*381381+ * SPARC on-board DM910x chips should be handled by the main382382+ * tulip driver, except for early DM9100s.383383+ */384384+#ifdef CONFIG_TULIP_DM910X385385+ if ((ent->driver_data == PCI_DM9100_ID && pdev->revision >= 0x30) ||386386+ ent->driver_data == PCI_DM9102_ID) {387387+ struct device_node *dp = pci_device_to_OF_node(pdev);388388+389389+ if (dp && of_get_property(dp, "local-mac-address", NULL)) {390390+ printk(KERN_INFO DRV_NAME391391+ ": skipping on-board DM910x (use tulip)\n");392392+ return -ENODEV;393393+ }394394+ }395395+#endif383396384397 /* Init network device */385398 dev = alloc_etherdev(sizeof(*db));
+25-7
drivers/net/tulip/tulip_core.c
···196196 | HAS_NWAY | HAS_PCI_MWI, tulip_timer, tulip_media_task },197197198198 /* DM910X */199199+#ifdef CONFIG_TULIP_DM910X199200 { "Davicom DM9102/DM9102A", 128, 0x0001ebef,200201 HAS_MII | HAS_MEDIA_TABLE | CSR12_IN_SROM | HAS_ACPI,201202 tulip_timer, tulip_media_task },203203+#else204204+ { NULL },205205+#endif202206203207 /* RS7112 */204208 { "Conexant LANfinity", 256, 0x0001ebef,···232228 { 0x1259, 0xa120, PCI_ANY_ID, PCI_ANY_ID, 0, 0, COMET },233229 { 0x11F6, 0x9881, PCI_ANY_ID, PCI_ANY_ID, 0, 0, COMPEX9881 },234230 { 0x8086, 0x0039, PCI_ANY_ID, PCI_ANY_ID, 0, 0, I21145 },231231+#ifdef CONFIG_TULIP_DM910X235232 { 0x1282, 0x9100, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DM910X },236233 { 0x1282, 0x9102, PCI_ANY_ID, PCI_ANY_ID, 0, 0, DM910X },234234+#endif237235 { 0x1113, 0x1216, PCI_ANY_ID, PCI_ANY_ID, 0, 0, COMET },238236 { 0x1113, 0x1217, PCI_ANY_ID, PCI_ANY_ID, 0, 0, MX98715 },239237 { 0x1113, 0x9511, PCI_ANY_ID, PCI_ANY_ID, 0, 0, COMET },···13051299 }1306130013071301 /*13081308- * Early DM9100's need software CRC and the DMFE driver13021302+ * DM910x chips should be handled by the dmfe driver, except13031303+ * on-board chips on SPARC systems. Also, early DM9100s need13041304+ * software CRC which only the dmfe driver supports.13091305 */1310130613111311- if (pdev->vendor == 0x1282 && pdev->device == 0x9100)13121312- {13131313- /* Read Chip revision */13141314- if (pdev->revision < 0x30)13151315- {13161316- printk(KERN_ERR PFX "skipping early DM9100 with Crc bug (use dmfe)\n");13071307+#ifdef CONFIG_TULIP_DM910X13081308+ if (chip_idx == DM910X) {13091309+ struct device_node *dp;13101310+13111311+ if (pdev->vendor == 0x1282 && pdev->device == 0x9100 &&13121312+ pdev->revision < 0x30) {13131313+ printk(KERN_INFO PFX13141314+ "skipping early DM9100 with Crc bug (use dmfe)\n");13151315+ return -ENODEV;13161316+ }13171317+13181318+ dp = pci_device_to_OF_node(pdev);13191319+ if (!(dp && of_get_property(dp, "local-mac-address", NULL))) {13201320+ printk(KERN_INFO PFX13211321+ "skipping DM910x expansion card (use dmfe)\n");13171322 return -ENODEV;13181323 }13191324 }13251325+#endif1320132613211327 /*13221328 * Looks for early PCI chipsets where people report hangs
···1563156315641564static void ugeth_quiesce(struct ucc_geth_private *ugeth)15651565{15661566- /* Wait for and prevent any further xmits. */15661566+ /* Prevent any further xmits, plus detach the device. */15671567+ netif_device_detach(ugeth->ndev);15681568+15691569+ /* Wait for any current xmits to finish. */15671570 netif_tx_disable(ugeth->ndev);1568157115691572 /* Disable the interrupt to avoid NAPI rescheduling. */···15801577{15811578 napi_enable(&ugeth->napi);15821579 enable_irq(ugeth->ug_info->uf_info.irq);15831583- netif_tx_wake_all_queues(ugeth->ndev);15801580+ netif_device_attach(ugeth->ndev);15841581}1585158215861583/* Called every time the controller might need to be made···16511648 ugeth->oldspeed = phydev->speed;16521649 }1653165016541654- /*16551655- * To change the MAC configuration we need to disable the16561656- * controller. To do so, we have to either grab ugeth->lock,16571657- * which is a bad idea since 'graceful stop' commands might16581658- * take quite a while, or we can quiesce driver's activity.16591659- */16601660- ugeth_quiesce(ugeth);16611661- ugeth_disable(ugeth, COMM_DIR_RX_AND_TX);16621662-16631663- out_be32(&ug_regs->maccfg2, tempval);16641664- out_be32(&uf_regs->upsmr, upsmr);16651665-16661666- ugeth_enable(ugeth, COMM_DIR_RX_AND_TX);16671667- ugeth_activate(ugeth);16681668-16691651 if (!ugeth->oldlink) {16701652 new_state = 1;16711653 ugeth->oldlink = 1;16541654+ }16551655+16561656+ if (new_state) {16571657+ /*16581658+ * To change the MAC configuration we need to disable16591659+ * the controller. To do so, we have to either grab16601660+ * ugeth->lock, which is a bad idea since 'graceful16611661+ * stop' commands might take quite a while, or we can16621662+ * quiesce driver's activity.16631663+ */16641664+ ugeth_quiesce(ugeth);16651665+ ugeth_disable(ugeth, COMM_DIR_RX_AND_TX);16661666+16671667+ out_be32(&ug_regs->maccfg2, tempval);16681668+ out_be32(&uf_regs->upsmr, upsmr);16691669+16701670+ ugeth_enable(ugeth, COMM_DIR_RX_AND_TX);16711671+ ugeth_activate(ugeth);16721672 }16731673 } else if (ugeth->oldlink) {16741674 new_state = 1;···32793273 /* Handle the transmitted buffer and release */32803274 /* the BD to be used with the current frame */3281327532823282- if ((bd == ugeth->txBd[txQ]) && (netif_queue_stopped(dev) == 0))32763276+ if (bd == ugeth->txBd[txQ]) /* queue empty? */32833277 break;3284327832853279 dev->stats.tx_packets++;···36073601 if (!netif_running(ndev))36083602 return 0;3609360336043604+ netif_device_detach(ndev);36103605 napi_disable(&ugeth->napi);3611360636123607 /*···36663659 phy_start(ugeth->phydev);3667366036683661 napi_enable(&ugeth->napi);36693669- netif_start_queue(ndev);36623662+ netif_device_attach(ndev);3670366336713664 return 0;36723665}
+7-6
drivers/net/ucc_geth.h
···838838 using the maximum is839839 easier */840840#define UCC_GETH_SEND_QUEUE_QUEUE_DESCRIPTOR_ALIGNMENT 32841841-#define UCC_GETH_SCHEDULER_ALIGNMENT 4 /* This is a guess */841841+#define UCC_GETH_SCHEDULER_ALIGNMENT 8 /* This is a guess */842842#define UCC_GETH_TX_STATISTICS_ALIGNMENT 4 /* This is a guess */843843#define UCC_GETH_RX_STATISTICS_ALIGNMENT 4 /* This is a guess */844844#define UCC_GETH_RX_INTERRUPT_COALESCING_ALIGNMENT 64845845#define UCC_GETH_RX_BD_QUEUES_ALIGNMENT 8 /* This is a guess */846846#define UCC_GETH_RX_PREFETCHED_BDS_ALIGNMENT 128 /* This is a guess */847847-#define UCC_GETH_RX_EXTENDED_FILTERING_GLOBAL_PARAMETERS_ALIGNMENT 4 /* This847847+#define UCC_GETH_RX_EXTENDED_FILTERING_GLOBAL_PARAMETERS_ALIGNMENT 8 /* This848848 is a849849 guess850850 */···899899#define UCC_GETH_UTFS_INIT 512 /* Tx virtual FIFO size900900 */901901#define UCC_GETH_UTFET_INIT 256 /* 1/2 utfs */902902-#define UCC_GETH_UTFTT_INIT 128902902+#define UCC_GETH_UTFTT_INIT 512903903/* Gigabit Ethernet (1000 Mbps) */904904#define UCC_GETH_URFS_GIGA_INIT 4096/*2048*/ /* Rx virtual905905 FIFO size */906906#define UCC_GETH_URFET_GIGA_INIT 2048/*1024*/ /* 1/2 urfs */907907#define UCC_GETH_URFSET_GIGA_INIT 3072/*1536*/ /* 3/4 urfs */908908-#define UCC_GETH_UTFS_GIGA_INIT 8192/*2048*/ /* Tx virtual908908+#define UCC_GETH_UTFS_GIGA_INIT 4096/*2048*/ /* Tx virtual909909 FIFO size */910910-#define UCC_GETH_UTFET_GIGA_INIT 4096/*1024*/ /* 1/2 utfs */911911-#define UCC_GETH_UTFTT_GIGA_INIT 0x400/*0x40*/ /* */910910+#define UCC_GETH_UTFET_GIGA_INIT 2048/*1024*/ /* 1/2 utfs */911911+#define UCC_GETH_UTFTT_GIGA_INIT 4096/*0x40*/ /* Tx virtual912912+ FIFO size */912913913914#define UCC_GETH_REMODER_INIT 0 /* bits that must be914915 set */
+77-28
drivers/net/usb/hso.c
···286286 u8 usb_gone;287287 struct work_struct async_get_intf;288288 struct work_struct async_put_intf;289289+ struct work_struct reset_device;289290290291 struct usb_device *usb;291292 struct usb_interface *interface;···333332/* Helper functions */334333static int hso_mux_submit_intr_urb(struct hso_shared_int *mux_int,335334 struct usb_device *usb, gfp_t gfp);336336-static void log_usb_status(int status, const char *function);335335+static void handle_usb_error(int status, const char *function,336336+ struct hso_device *hso_dev);337337static struct usb_endpoint_descriptor *hso_get_ep(struct usb_interface *intf,338338 int type, int dir);339339static int hso_get_mux_ports(struct usb_interface *intf, unsigned char *ports);···352350static int hso_put_activity(struct hso_device *hso_dev);353351static int hso_get_activity(struct hso_device *hso_dev);354352static void tiocmget_intr_callback(struct urb *urb);353353+static void reset_device(struct work_struct *data);355354/*****************************************************************************/356355/* Helping functions */357356/*****************************************************************************/···464461 {USB_DEVICE(0x0af0, 0x7501)}, /* GTM 382 */465462 {USB_DEVICE(0x0af0, 0x7601)}, /* GE40x */466463 {USB_DEVICE(0x0af0, 0x7701)},464464+ {USB_DEVICE(0x0af0, 0x7706)},467465 {USB_DEVICE(0x0af0, 0x7801)},468466 {USB_DEVICE(0x0af0, 0x7901)},467467+ {USB_DEVICE(0x0af0, 0x7A01)},468468+ {USB_DEVICE(0x0af0, 0x7A05)},469469 {USB_DEVICE(0x0af0, 0x8200)},470470 {USB_DEVICE(0x0af0, 0x8201)},471471+ {USB_DEVICE(0x0af0, 0x8300)},472472+ {USB_DEVICE(0x0af0, 0x8302)},473473+ {USB_DEVICE(0x0af0, 0x8304)},474474+ {USB_DEVICE(0x0af0, 0x8400)},471475 {USB_DEVICE(0x0af0, 0xd035)},472476 {USB_DEVICE(0x0af0, 0xd055)},473477 {USB_DEVICE(0x0af0, 0xd155)},···483473 {USB_DEVICE(0x0af0, 0xd157)},484474 {USB_DEVICE(0x0af0, 0xd257)},485475 {USB_DEVICE(0x0af0, 0xd357)},476476+ {USB_DEVICE(0x0af0, 0xd058)},477477+ {USB_DEVICE(0x0af0, 0xc100)},486478 {}487479};488480MODULE_DEVICE_TABLE(usb, hso_ids);···667655 spin_unlock_irqrestore(&serial_table_lock, flags);668656}669657670670-/* log a meaningful explanation of an USB status */671671-static void log_usb_status(int status, const char *function)658658+static void handle_usb_error(int status, const char *function,659659+ struct hso_device *hso_dev)672660{673661 char *explanation;674662···697685 case -EMSGSIZE:698686 explanation = "internal error";699687 break;688688+ case -EILSEQ:689689+ case -EPROTO:690690+ case -ETIME:691691+ case -ETIMEDOUT:692692+ explanation = "protocol error";693693+ if (hso_dev)694694+ schedule_work(&hso_dev->reset_device);695695+ break;700696 default:701697 explanation = "unknown status";702698 break;703699 }700700+701701+ /* log a meaningful explanation of an USB status */704702 D1("%s: received USB status - %s (%d)", function, explanation, status);705703}706704···784762 /* log status, but don't act on it, we don't need to resubmit anything785763 * anyhow */786764 if (status)787787- log_usb_status(status, __func__);765765+ handle_usb_error(status, __func__, odev->parent);788766789767 hso_put_activity(odev->parent);790768···828806 result = usb_submit_urb(odev->mux_bulk_tx_urb, GFP_ATOMIC);829807 if (result) {830808 dev_warn(&odev->parent->interface->dev,831831- "failed mux_bulk_tx_urb %d", result);809809+ "failed mux_bulk_tx_urb %d\n", result);832810 net->stats.tx_errors++;833811 netif_start_queue(net);834812 } else {···10209981021999 /* is al ok? (Filip: Who's Al ?) */10221000 if (status) {10231023- log_usb_status(status, __func__);10011001+ handle_usb_error(status, __func__, odev->parent);10241002 return;10251003 }10261004···10411019 if (odev->parent->port_spec & HSO_INFO_CRC_BUG) {10421020 u32 rest;10431021 u8 crc_check[4] = { 0xDE, 0xAD, 0xBE, 0xEF };10441044- rest = urb->actual_length % odev->in_endp->wMaxPacketSize;10221022+ rest = urb->actual_length %10231023+ le16_to_cpu(odev->in_endp->wMaxPacketSize);10451024 if (((rest == 5) || (rest == 6)) &&10461025 !memcmp(((u8 *) urb->transfer_buffer) +10471026 urb->actual_length - 4, crc_check, 4)) {···10761053 result = usb_submit_urb(urb, GFP_ATOMIC);10771054 if (result)10781055 dev_warn(&odev->parent->interface->dev,10791079- "%s failed submit mux_bulk_rx_urb %d", __func__,10561056+ "%s failed submit mux_bulk_rx_urb %d\n", __func__,10801057 result);10811058}10821059···12301207 D1("serial == NULL");12311208 return;12321209 } else if (status) {12331233- log_usb_status(status, __func__);12101210+ handle_usb_error(status, __func__, serial->parent);12341211 return;12351212 }12361213···12481225 u8 crc_check[4] = { 0xDE, 0xAD, 0xBE, 0xEF };12491226 rest =12501227 urb->actual_length %12511251- serial->in_endp->wMaxPacketSize;12281228+ le16_to_cpu(serial->in_endp->wMaxPacketSize);12521229 if (((rest == 5) || (rest == 6)) &&12531230 !memcmp(((u8 *) urb->transfer_buffer) +12541231 urb->actual_length - 4, crc_check, 4)) {···15361513 if (!serial)15371514 return;15381515 if (status) {15391539- log_usb_status(status, __func__);15161516+ handle_usb_error(status, __func__, serial->parent);15401517 return;15411518 }15421519 tiocmget = serial->tiocmget;···17231700 D1("no tty structures");17241701 return -EINVAL;17251702 }17031703+17041704+ if ((serial->parent->port_spec & HSO_PORT_MASK) != HSO_PORT_MODEM)17051705+ return -EINVAL;17061706+17261707 if_num = serial->parent->interface->altsetting->desc.bInterfaceNumber;1727170817281709 spin_lock_irqsave(&serial->serial_lock, flags);···18651838 result = usb_submit_urb(ctrl_urb, GFP_ATOMIC);18661839 if (result) {18671840 dev_err(&ctrl_urb->dev->dev,18681868- "%s failed submit ctrl_urb %d type %d", __func__,18411841+ "%s failed submit ctrl_urb %d type %d\n", __func__,18691842 result, type);18701843 return result;18711844 }···1915188819161889 /* status check */19171890 if (status) {19181918- log_usb_status(status, __func__);18911891+ handle_usb_error(status, __func__, NULL);19191892 return;19201893 }19211894 D4("\n--- Got intr callback 0x%02X ---", status);···19321905 if (serial != NULL) {19331906 D1("Pending read interrupt on port %d\n", i);19341907 spin_lock(&serial->serial_lock);19351935- if (serial->rx_state == RX_IDLE) {19081908+ if (serial->rx_state == RX_IDLE &&19091909+ serial->open_count > 0) {19361910 /* Setup and send a ctrl req read on19371911 * port i */19381938- if (!serial->rx_urb_filled[0]) {19121912+ if (!serial->rx_urb_filled[0]) {19391913 serial->rx_state = RX_SENT;19401914 hso_mux_serial_read(serial);19411915 } else19421916 serial->rx_state = RX_PENDING;19431943-19441917 } else {19451945- D1("Already pending a read on "19461946- "port %d\n", i);19181918+ D1("Already a read pending on "19191919+ "port %d or port not open\n", i);19471920 }19481921 spin_unlock(&serial->serial_lock);19491922 }···19851958 tty = tty_kref_get(serial->tty);19861959 spin_unlock(&serial->serial_lock);19871960 if (status) {19881988- log_usb_status(status, __func__);19611961+ handle_usb_error(status, __func__, serial->parent);19891962 tty_kref_put(tty);19901963 return;19911964 }···20412014 tty = tty_kref_get(serial->tty);20422015 spin_unlock(&serial->serial_lock);20432016 if (status) {20442044- log_usb_status(status, __func__);20172017+ handle_usb_error(status, __func__, serial->parent);20452018 tty_kref_put(tty);20462019 return;20472020 }···23852358 serial->tx_data_length = tx_size;23862359 serial->tx_data = kzalloc(serial->tx_data_length, GFP_KERNEL);23872360 if (!serial->tx_data) {23882388- dev_err(dev, "%s - Out of memory", __func__);23612361+ dev_err(dev, "%s - Out of memory\n", __func__);23892362 goto exit;23902363 }23912364 serial->tx_buffer = kzalloc(serial->tx_data_length, GFP_KERNEL);23922365 if (!serial->tx_buffer) {23932393- dev_err(dev, "%s - Out of memory", __func__);23662366+ dev_err(dev, "%s - Out of memory\n", __func__);23942367 goto exit;23952368 }23962369···2418239124192392 INIT_WORK(&hso_dev->async_get_intf, async_get_intf);24202393 INIT_WORK(&hso_dev->async_put_intf, async_put_intf);23942394+ INIT_WORK(&hso_dev->reset_device, reset_device);2421239524222396 return hso_dev;24232397}···2859283128602832 mux->shared_intr_urb = usb_alloc_urb(0, GFP_KERNEL);28612833 if (!mux->shared_intr_urb) {28622862- dev_err(&interface->dev, "Could not allocate intr urb?");28342834+ dev_err(&interface->dev, "Could not allocate intr urb?\n");28632835 goto exit;28642836 }28652865- mux->shared_intr_buf = kzalloc(mux->intr_endp->wMaxPacketSize,28662866- GFP_KERNEL);28372837+ mux->shared_intr_buf =28382838+ kzalloc(le16_to_cpu(mux->intr_endp->wMaxPacketSize),28392839+ GFP_KERNEL);28672840 if (!mux->shared_intr_buf) {28682868- dev_err(&interface->dev, "Could not allocate intr buf?");28412841+ dev_err(&interface->dev, "Could not allocate intr buf?\n");28692842 goto exit;28702843 }28712844···31613132 return result;31623133}3163313431353135+static void reset_device(struct work_struct *data)31363136+{31373137+ struct hso_device *hso_dev =31383138+ container_of(data, struct hso_device, reset_device);31393139+ struct usb_device *usb = hso_dev->usb;31403140+ int result;31413141+31423142+ if (hso_dev->usb_gone) {31433143+ D1("No reset during disconnect\n");31443144+ } else {31453145+ result = usb_lock_device_for_reset(usb, hso_dev->interface);31463146+ if (result < 0)31473147+ D1("unable to lock device for reset: %d\n", result);31483148+ else {31493149+ usb_reset_device(usb);31503150+ usb_unlock_device(usb);31513151+ }31523152+ }31533153+}31543154+31643155static void hso_serial_ref_free(struct kref *ref)31653156{31663157 struct hso_device *hso_dev = container_of(ref, struct hso_device, ref);···32813232 usb_rcvintpipe(usb,32823233 shared_int->intr_endp->bEndpointAddress & 0x7F),32833234 shared_int->shared_intr_buf,32843284- shared_int->intr_endp->wMaxPacketSize,32353235+ 1,32853236 intr_callback, shared_int,32863237 shared_int->intr_endp->bInterval);3287323832883239 result = usb_submit_urb(shared_int->shared_intr_urb, gfp);32893240 if (result)32903290- dev_warn(&usb->dev, "%s failed mux_intr_urb %d", __func__,32413241+ dev_warn(&usb->dev, "%s failed mux_intr_urb %d\n", __func__,32913242 result);3292324332933244 return result;
+2-2
drivers/net/usb/rtl8150.c
···270270 get_registers(dev, PHYCNT, 1, data);271271 } while ((data[0] & PHY_GO) && (i++ < MII_TIMEOUT));272272273273- if (i < MII_TIMEOUT) {273273+ if (i <= MII_TIMEOUT) {274274 get_registers(dev, PHYDAT, 2, data);275275 *reg = data[0] | (data[1] << 8);276276 return 0;···295295 get_registers(dev, PHYCNT, 1, data);296296 } while ((data[0] & PHY_GO) && (i++ < MII_TIMEOUT));297297298298- if (i < MII_TIMEOUT)298298+ if (i <= MII_TIMEOUT)299299 return 0;300300 else301301 return 1;
···250250 __u64 count; /* Default No packets to send */251251 __u64 sofar; /* How many pkts we've sent so far */252252 __u64 tx_bytes; /* How many bytes we've transmitted */253253- __u64 errors; /* Errors when trying to transmit,254254- pkts will be re-sent */253253+ __u64 errors; /* Errors when trying to transmit, */255254256255 /* runtime counters relating to clone_skb */257256···34633464 pkt_dev->sofar++;34643465 pkt_dev->seq_num++;34653466 pkt_dev->tx_bytes += pkt_dev->last_pkt_size;34673467+ break;34683468+ case NET_XMIT_DROP:34693469+ case NET_XMIT_CN:34703470+ case NET_XMIT_POLICED:34713471+ /* skb has been consumed */34723472+ pkt_dev->errors++;34663473 break;34673474 default: /* Drivers are not supposed to return other values! */34683475 if (net_ratelimit())
+4
net/core/sock.c
···1205120512061206 if (newsk->sk_prot->sockets_allocated)12071207 percpu_counter_inc(newsk->sk_prot->sockets_allocated);12081208+12091209+ if (sock_flag(newsk, SOCK_TIMESTAMP) ||12101210+ sock_flag(newsk, SOCK_TIMESTAMPING_RX_SOFTWARE))12111211+ net_enable_timestamp();12081212 }12091213out:12101214 return newsk;
···254254 */255255256256 if (rt->rt_flags&RTCF_MULTICAST) {257257- if ((!sk || inet_sk(sk)->mc_loop)257257+ if (sk_mc_loop(sk)258258#ifdef CONFIG_IP_MROUTE259259 /* Small optimization: do not loopback not local frames,260260 which returned after forwarding; they will be dropped
···112112 module, choose M here. If unsure, say N.113113114114config IP_VS_WRR115115- tristate "weighted round-robin scheduling" 115115+ tristate "weighted round-robin scheduling"116116+ select GCD116117 ---help---117118 The weighted robin-robin scheduling algorithm directs network118119 connections to different real servers based on server weights
+13-1
net/netfilter/ipvs/ip_vs_ctl.c
···20772077 if (!capable(CAP_NET_ADMIN))20782078 return -EPERM;2079207920802080+ if (cmd < IP_VS_BASE_CTL || cmd > IP_VS_SO_SET_MAX)20812081+ return -EINVAL;20822082+ if (len < 0 || len > MAX_ARG_LEN)20832083+ return -EINVAL;20802084 if (len != set_arglen[SET_CMDID(cmd)]) {20812085 pr_err("set_ctl: len %u != %u\n",20822086 len, set_arglen[SET_CMDID(cmd)]);···23562352{23572353 unsigned char arg[128];23582354 int ret = 0;23552355+ unsigned int copylen;2359235623602357 if (!capable(CAP_NET_ADMIN))23612358 return -EPERM;23592359+23602360+ if (cmd < IP_VS_BASE_CTL || cmd > IP_VS_SO_GET_MAX)23612361+ return -EINVAL;2362236223632363 if (*len < get_arglen[GET_CMDID(cmd)]) {23642364 pr_err("get_ctl: len %u < %u\n",···23702362 return -EINVAL;23712363 }2372236423732373- if (copy_from_user(arg, user, get_arglen[GET_CMDID(cmd)]) != 0)23652365+ copylen = get_arglen[GET_CMDID(cmd)];23662366+ if (copylen > 128)23672367+ return -EINVAL;23682368+23692369+ if (copy_from_user(arg, user, copylen) != 0)23742370 return -EFAULT;2375237123762372 if (mutex_lock_interruptible(&__ip_vs_mutex))
+1-14
net/netfilter/ipvs/ip_vs_wrr.c
···2424#include <linux/module.h>2525#include <linux/kernel.h>2626#include <linux/net.h>2727+#include <linux/gcd.h>27282829#include <net/ip_vs.h>2930···3837 int di; /* decreasing interval */3938};40394141-4242-/*4343- * Get the gcd of server weights4444- */4545-static int gcd(int a, int b)4646-{4747- int c;4848-4949- while ((c = a % b)) {5050- a = b;5151- b = c;5252- }5353- return b;5454-}55405641static int ip_vs_wrr_gcd_weight(struct ip_vs_service *svc)5742{
+9-9
net/netfilter/nf_conntrack_ftp.c
···323323 struct nf_ct_ftp_master *info, int dir,324324 struct sk_buff *skb)325325{326326- unsigned int i, oldest = NUM_SEQ_TO_REMEMBER;326326+ unsigned int i, oldest;327327328328 /* Look for oldest: if we find exact match, we're done. */329329 for (i = 0; i < info->seq_aft_nl_num[dir]; i++) {330330 if (info->seq_aft_nl[dir][i] == nl_seq)331331 return;332332-333333- if (oldest == info->seq_aft_nl_num[dir] ||334334- before(info->seq_aft_nl[dir][i],335335- info->seq_aft_nl[dir][oldest]))336336- oldest = i;337332 }338333339334 if (info->seq_aft_nl_num[dir] < NUM_SEQ_TO_REMEMBER) {340335 info->seq_aft_nl[dir][info->seq_aft_nl_num[dir]++] = nl_seq;341341- } else if (oldest != NUM_SEQ_TO_REMEMBER &&342342- after(nl_seq, info->seq_aft_nl[dir][oldest])) {343343- info->seq_aft_nl[dir][oldest] = nl_seq;336336+ } else {337337+ if (before(info->seq_aft_nl[dir][0], info->seq_aft_nl[dir][1]))338338+ oldest = 0;339339+ else340340+ oldest = 1;341341+342342+ if (after(nl_seq, info->seq_aft_nl[dir][oldest]))343343+ info->seq_aft_nl[dir][oldest] = nl_seq;344344 }345345}346346