#include <linux/udp.h>
#include <linux/cache.h>
#include <asm/io.h>
+#include <asm/irq.h>
#include <asm/uaccess.h>
/* VLAN tagging feature enable/disable */
};
struct cp_private {
- void *regs;
+ void __iomem *regs;
struct net_device *dev;
spinlock_t lock;
u32 msg_enable;
#endif
unsigned int wol_enabled : 1; /* Is Wake-on-LAN enabled? */
- u32 power_state[16];
struct mii_if_info mii_if;
};
static struct pci_device_id cp_pci_tbl[] = {
{ PCI_VENDOR_ID_REALTEK, PCI_DEVICE_ID_REALTEK_8139,
PCI_ANY_ID, PCI_ANY_ID, 0, 0, },
+ { PCI_VENDOR_ID_TTTECH, PCI_DEVICE_ID_TTTECH_MC322,
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0, },
{ },
};
MODULE_DEVICE_TABLE(pci, cp_pci_tbl);
#define EE_READ_CMD (6)
#define EE_ERASE_CMD (7)
-static int read_eeprom (void *ioaddr, int location, int addr_len)
+static int read_eeprom (void __iomem *ioaddr, int location, int addr_len)
{
int i;
unsigned retval = 0;
- void *ee_addr = ioaddr + Cfg9346;
+ void __iomem *ee_addr = ioaddr + Cfg9346;
int read_cmd = location | (EE_READ_CMD << addr_len);
writeb (EE_ENB & ~EE_CS, ee_addr);
static void cp_set_d3_state (struct cp_private *cp)
{
pci_enable_wake (cp->pdev, 0, 1); /* Enable PME# generation */
- pci_set_power_state (cp->pdev, 3);
+ pci_set_power_state (cp->pdev, PCI_D3hot);
}
static int cp_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
struct net_device *dev;
struct cp_private *cp;
int rc;
- void *regs;
+ void __iomem *regs;
long pciaddr;
unsigned int addr_len, i, pci_using_dac;
u8 pci_rev;
BUG();
unregister_netdev(dev);
iounmap(cp->regs);
- if (cp->wol_enabled) pci_set_power_state (pdev, 0);
+ if (cp->wol_enabled) pci_set_power_state (pdev, PCI_D0);
pci_release_regions(pdev);
pci_clear_mwi(pdev);
pci_disable_device(pdev);
spin_unlock_irqrestore (&cp->lock, flags);
if (cp->pdev && cp->wol_enabled) {
- pci_save_state (cp->pdev, cp->power_state);
+ pci_save_state (cp->pdev);
cp_set_d3_state (cp);
}
netif_device_attach (dev);
if (cp->pdev && cp->wol_enabled) {
- pci_set_power_state (cp->pdev, 0);
- pci_restore_state (cp->pdev, cp->power_state);
+ pci_set_power_state (cp->pdev, PCI_D0);
+ pci_restore_state (cp->pdev);
}
cp_init_hw (cp);