#define DRV_NAME "e100"
-#define DRV_EXT "-NAPI"
-#define DRV_VERSION "3.2.3-k2"DRV_EXT
+#define DRV_EXT "-NAPI"
+#define DRV_VERSION "3.0.27-k2"DRV_EXT
#define DRV_DESCRIPTION "Intel(R) PRO/100 Network Driver"
#define DRV_COPYRIGHT "Copyright(c) 1999-2004 Intel Corporation"
#define PFX DRV_NAME ": "
MODULE_DESCRIPTION(DRV_DESCRIPTION);
MODULE_AUTHOR(DRV_COPYRIGHT);
MODULE_LICENSE("GPL");
+MODULE_VERSION(DRV_VERSION);
static int debug = 3;
module_param(debug, int, 0);
spinlock_t cb_lock ____cacheline_aligned;
spinlock_t cmd_lock;
- struct csr __iomem *csr;
+ struct csr *csr;
enum scb_cmd_lo cuc_cmd;
unsigned int cbs_avail;
struct cb *cbs;
u16 leds;
u16 eeprom_wc;
u16 eeprom[256];
+ u32 pm_state[16];
};
static inline void e100_write_flush(struct nic *nic)
writel(software_reset, &nic->csr->port);
e100_write_flush(nic); udelay(20);
+ /* TCO workaround - 82559 and greater */
+ if(nic->mac >= mac_82559_D101M) {
+ /* Issue a redundant CU load base without setting
+ * general pointer, and without waiting for scb to
+ * clear. This gets us into post-driver. Finally,
+ * wait 20 msec for reset to take effect. */
+ writeb(cuc_load_base, &nic->csr->scb.cmd_lo);
+ mdelay(20);
+ }
+
/* Mask off our interrupt line - it's unmasked after reset */
e100_disable_irq(nic);
}
switch(err) {
case -ENOSPC:
/* We queued the skb, but now we're out of space. */
- DPRINTK(TX_ERR, DEBUG, "No space for CB\n");
netif_stop_queue(netdev);
break;
case -ENOMEM:
#define RFD_BUF_LEN (sizeof(struct rfd) + VLAN_ETH_FRAME_LEN)
static inline int e100_rx_alloc_skb(struct nic *nic, struct rx *rx)
{
- if(!(rx->skb = dev_alloc_skb(RFD_BUF_LEN + NET_IP_ALIGN)))
+ unsigned int rx_offset = 2; /* u32 align protocol headers */
+
+ if(!(rx->skb = dev_alloc_skb(RFD_BUF_LEN + rx_offset)))
return -ENOMEM;
/* Align, init, and map the RFD. */
rx->skb->dev = nic->netdev;
- skb_reserve(rx->skb, NET_IP_ALIGN);
+ skb_reserve(rx->skb, rx_offset);
memcpy(rx->skb->data, &nic->blank_rfd, sizeof(struct rfd));
rx->dma_addr = pci_map_single(nic->pdev, rx->skb->data,
RFD_BUF_LEN, PCI_DMA_BIDIRECTIONAL);
/* If data isn't ready, nothing to indicate */
if(unlikely(!(rfd_status & cb_complete)))
- return -EAGAIN;
+ return -EAGAIN;
/* Get actual data size */
actual_size = le16_to_cpu(rfd->actual_size) & 0x3FFF;
if(memcmp(nic->rx_to_clean->skb->data + sizeof(struct rfd),
skb->data, ETH_DATA_LEN))
- err = -EAGAIN;
+ err = -EAGAIN;
err_loopback_none:
mdio_write(nic->netdev, nic->mii.phy_id, MII_BMCR, 0);
rfds->count = min(rfds->count, rfds->max);
cbs->count = max(ring->tx_pending, cbs->min);
cbs->count = min(cbs->count, cbs->max);
- DPRINTK(DRV, INFO, "Ring Param settings: rx: %d, tx %d\n",
- rfds->count, cbs->count);
if(netif_running(netdev))
e100_up(nic);
#ifdef CONFIG_NET_POLL_CONTROLLER
netdev->poll_controller = e100_netpoll;
#endif
- strcpy(netdev->name, pci_name(pdev));
nic = netdev_priv(netdev);
nic->netdev = netdev;
goto err_out_disable_pdev;
}
+ pci_set_master(pdev);
+
if((err = pci_set_dma_mask(pdev, 0xFFFFFFFFULL))) {
DPRINTK(PROBE, ERR, "No usable DMA configuration, aborting.\n");
goto err_out_free_res;
else
nic->flags &= ~ich;
- e100_get_defaults(nic);
-
spin_lock_init(&nic->cb_lock);
spin_lock_init(&nic->cmd_lock);
- /* Reset the device before pci_set_master() in case device is in some
- * funky state and has an interrupt pending - hint: we don't have the
- * interrupt handler registered yet. */
- e100_hw_reset(nic);
-
- pci_set_master(pdev);
-
init_timer(&nic->watchdog);
nic->watchdog.function = e100_watchdog;
nic->watchdog.data = (unsigned long)nic;
goto err_out_iounmap;
}
+ e100_get_defaults(nic);
+ e100_hw_reset(nic);
e100_phy_init(nic);
if((err = e100_eeprom_load(nic)))
pci_enable_wake(pdev, 0, nic->flags & (wol_magic | e100_asf(nic)));
- strcpy(netdev->name, "eth%d");
if((err = register_netdev(netdev))) {
DPRINTK(PROBE, ERR, "Cannot register net device, aborting.\n");
goto err_out_free;
e100_hw_reset(nic);
netif_device_detach(netdev);
- pci_save_state(pdev);
+ pci_save_state(pdev, nic->pm_state);
pci_enable_wake(pdev, state, nic->flags & (wol_magic | e100_asf(nic)));
pci_disable_device(pdev);
pci_set_power_state(pdev, state);
struct nic *nic = netdev_priv(netdev);
pci_set_power_state(pdev, 0);
- pci_restore_state(pdev);
+ pci_restore_state(pdev, nic->pm_state);
e100_hw_init(nic);
netif_device_attach(netdev);
printk(KERN_INFO PFX "%s, %s\n", DRV_DESCRIPTION, DRV_VERSION);
printk(KERN_INFO PFX "%s\n", DRV_COPYRIGHT);
}
- return pci_module_init(&e100_driver);
+ return pci_module_init(&e100_driver);
}
static void __exit e100_cleanup_module(void)