Commit d63f269f authored by Jeff Garzik's avatar Jeff Garzik

Merge pobox.com:/spare/repo/linux-2.6

into pobox.com:/spare/repo/netdev-2.6/acenic
parents 8fc0532a fa376558
...@@ -539,7 +539,7 @@ static int __devinit acenic_probe_one(struct pci_dev *pdev, ...@@ -539,7 +539,7 @@ static int __devinit acenic_probe_one(struct pci_dev *pdev,
* addresses but who gives a damn. * addresses but who gives a damn.
*/ */
dev->base_addr = pci_resource_start(pdev, 0); dev->base_addr = pci_resource_start(pdev, 0);
ap->regs = (struct ace_regs *)ioremap(dev->base_addr, 0x4000); ap->regs = ioremap(dev->base_addr, 0x4000);
if (!ap->regs) { if (!ap->regs) {
printk(KERN_ERR "%s: Unable to map I/O register, " printk(KERN_ERR "%s: Unable to map I/O register, "
"AceNIC %i will be disabled.\n", "AceNIC %i will be disabled.\n",
...@@ -632,7 +632,7 @@ static void __devexit acenic_remove_one(struct pci_dev *pdev) ...@@ -632,7 +632,7 @@ static void __devexit acenic_remove_one(struct pci_dev *pdev)
{ {
struct net_device *dev = pci_get_drvdata(pdev); struct net_device *dev = pci_get_drvdata(pdev);
struct ace_private *ap = netdev_priv(dev); struct ace_private *ap = netdev_priv(dev);
struct ace_regs *regs = ap->regs; struct ace_regs __iomem *regs = ap->regs;
short i; short i;
unregister_netdev(dev); unregister_netdev(dev);
...@@ -885,7 +885,7 @@ static void ace_init_cleanup(struct net_device *dev) ...@@ -885,7 +885,7 @@ static void ace_init_cleanup(struct net_device *dev)
/* /*
* Commands are considered to be slow. * Commands are considered to be slow.
*/ */
static inline void ace_issue_cmd(struct ace_regs *regs, struct cmd *cmd) static inline void ace_issue_cmd(struct ace_regs __iomem *regs, struct cmd *cmd)
{ {
u32 idx; u32 idx;
...@@ -901,7 +901,7 @@ static inline void ace_issue_cmd(struct ace_regs *regs, struct cmd *cmd) ...@@ -901,7 +901,7 @@ static inline void ace_issue_cmd(struct ace_regs *regs, struct cmd *cmd)
static int __init ace_init(struct net_device *dev) static int __init ace_init(struct net_device *dev)
{ {
struct ace_private *ap; struct ace_private *ap;
struct ace_regs *regs; struct ace_regs __iomem *regs;
struct ace_info *info = NULL; struct ace_info *info = NULL;
struct pci_dev *pdev; struct pci_dev *pdev;
unsigned long myjif; unsigned long myjif;
...@@ -1319,11 +1319,10 @@ static int __init ace_init(struct net_device *dev) ...@@ -1319,11 +1319,10 @@ static int __init ace_init(struct net_device *dev)
writel(TX_RING_BASE, &regs->WinBase); writel(TX_RING_BASE, &regs->WinBase);
if (ACE_IS_TIGON_I(ap)) { if (ACE_IS_TIGON_I(ap)) {
ap->tx_ring = (struct tx_desc *)regs->Window; ap->tx_ring = (struct tx_desc *) regs->Window;
for (i = 0; i < (TIGON_I_TX_RING_ENTRIES * for (i = 0; i < (TIGON_I_TX_RING_ENTRIES
sizeof(struct tx_desc) / 4); i++) { * sizeof(struct tx_desc)) / sizeof(u32); i++)
writel(0, (unsigned long)ap->tx_ring + i * 4); writel(0, (void __iomem *)ap->tx_ring + i * 4);
}
set_aceaddr(&info->tx_ctrl.rngptr, TX_RING_BASE); set_aceaddr(&info->tx_ctrl.rngptr, TX_RING_BASE);
} else { } else {
...@@ -1550,14 +1549,9 @@ static int __init ace_init(struct net_device *dev) ...@@ -1550,14 +1549,9 @@ static int __init ace_init(struct net_device *dev)
static void ace_set_rxtx_parms(struct net_device *dev, int jumbo) static void ace_set_rxtx_parms(struct net_device *dev, int jumbo)
{ {
struct ace_private *ap; struct ace_private *ap = netdev_priv(dev);
struct ace_regs *regs; struct ace_regs __iomem *regs = ap->regs;
int board_idx; int board_idx = ap->board_idx;
ap = netdev_priv(dev);
regs = ap->regs;
board_idx = ap->board_idx;
if (board_idx >= 0) { if (board_idx >= 0) {
if (!jumbo) { if (!jumbo) {
...@@ -1595,7 +1589,7 @@ static void ace_watchdog(struct net_device *data) ...@@ -1595,7 +1589,7 @@ static void ace_watchdog(struct net_device *data)
{ {
struct net_device *dev = data; struct net_device *dev = data;
struct ace_private *ap = netdev_priv(dev); struct ace_private *ap = netdev_priv(dev);
struct ace_regs *regs = ap->regs; struct ace_regs __iomem *regs = ap->regs;
/* /*
* We haven't received a stats update event for more than 2.5 * We haven't received a stats update event for more than 2.5
...@@ -1618,7 +1612,7 @@ static void ace_watchdog(struct net_device *data) ...@@ -1618,7 +1612,7 @@ static void ace_watchdog(struct net_device *data)
static void ace_tasklet(unsigned long dev) static void ace_tasklet(unsigned long dev)
{ {
struct ace_private *ap = ((struct net_device *)dev)->priv; struct ace_private *ap = netdev_priv((struct net_device *)dev);
int cur_size; int cur_size;
cur_size = atomic_read(&ap->cur_rx_bufs); cur_size = atomic_read(&ap->cur_rx_bufs);
...@@ -1676,10 +1670,9 @@ static void ace_dump_trace(struct ace_private *ap) ...@@ -1676,10 +1670,9 @@ static void ace_dump_trace(struct ace_private *ap)
*/ */
static void ace_load_std_rx_ring(struct ace_private *ap, int nr_bufs) static void ace_load_std_rx_ring(struct ace_private *ap, int nr_bufs)
{ {
struct ace_regs *regs; struct ace_regs __iomem *regs = ap->regs;
short i, idx; short i, idx;
regs = ap->regs;
prefetchw(&ap->cur_rx_bufs); prefetchw(&ap->cur_rx_bufs);
...@@ -1740,11 +1733,9 @@ static void ace_load_std_rx_ring(struct ace_private *ap, int nr_bufs) ...@@ -1740,11 +1733,9 @@ static void ace_load_std_rx_ring(struct ace_private *ap, int nr_bufs)
static void ace_load_mini_rx_ring(struct ace_private *ap, int nr_bufs) static void ace_load_mini_rx_ring(struct ace_private *ap, int nr_bufs)
{ {
struct ace_regs *regs; struct ace_regs __iomem *regs = ap->regs;
short i, idx; short i, idx;
regs = ap->regs;
prefetchw(&ap->cur_mini_bufs); prefetchw(&ap->cur_mini_bufs);
idx = ap->rx_mini_skbprd; idx = ap->rx_mini_skbprd;
...@@ -1799,11 +1790,9 @@ static void ace_load_mini_rx_ring(struct ace_private *ap, int nr_bufs) ...@@ -1799,11 +1790,9 @@ static void ace_load_mini_rx_ring(struct ace_private *ap, int nr_bufs)
*/ */
static void ace_load_jumbo_rx_ring(struct ace_private *ap, int nr_bufs) static void ace_load_jumbo_rx_ring(struct ace_private *ap, int nr_bufs)
{ {
struct ace_regs *regs; struct ace_regs __iomem *regs = ap->regs;
short i, idx; short i, idx;
regs = ap->regs;
idx = ap->rx_jumbo_skbprd; idx = ap->rx_jumbo_skbprd;
for (i = 0; i < nr_bufs; i++) { for (i = 0; i < nr_bufs; i++) {
...@@ -2083,8 +2072,7 @@ static void ace_rx_int(struct net_device *dev, u32 rxretprd, u32 rxretcsm) ...@@ -2083,8 +2072,7 @@ static void ace_rx_int(struct net_device *dev, u32 rxretprd, u32 rxretcsm)
* the 12.3.x Firmware - my Tigon I NICs seem to disagree! * the 12.3.x Firmware - my Tigon I NICs seem to disagree!
*/ */
if (ACE_IS_TIGON_I(ap)) { if (ACE_IS_TIGON_I(ap)) {
struct ace_regs *regs = ap->regs; writel(idx, &ap->regs->RxRetCsm);
writel(idx, &regs->RxRetCsm);
} }
ap->cur_rx = idx; ap->cur_rx = idx;
...@@ -2164,16 +2152,13 @@ static inline void ace_tx_int(struct net_device *dev, ...@@ -2164,16 +2152,13 @@ static inline void ace_tx_int(struct net_device *dev,
static irqreturn_t ace_interrupt(int irq, void *dev_id, struct pt_regs *ptregs) static irqreturn_t ace_interrupt(int irq, void *dev_id, struct pt_regs *ptregs)
{ {
struct ace_private *ap;
struct ace_regs *regs;
struct net_device *dev = (struct net_device *)dev_id; struct net_device *dev = (struct net_device *)dev_id;
struct ace_private *ap = netdev_priv(dev);
struct ace_regs __iomem *regs = ap->regs;
u32 idx; u32 idx;
u32 txcsm, rxretcsm, rxretprd; u32 txcsm, rxretcsm, rxretprd;
u32 evtcsm, evtprd; u32 evtcsm, evtprd;
ap = netdev_priv(dev);
regs = ap->regs;
/* /*
* In case of PCI shared interrupts or spurious interrupts, * In case of PCI shared interrupts or spurious interrupts,
* we want to make sure it is actually our interrupt before * we want to make sure it is actually our interrupt before
...@@ -2326,13 +2311,10 @@ static void ace_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid) ...@@ -2326,13 +2311,10 @@ static void ace_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid)
static int ace_open(struct net_device *dev) static int ace_open(struct net_device *dev)
{ {
struct ace_private *ap; struct ace_private *ap = netdev_priv(dev);
struct ace_regs *regs; struct ace_regs __iomem *regs = ap->regs;
struct cmd cmd; struct cmd cmd;
ap = netdev_priv(dev);
regs = ap->regs;
if (!(ap->fw_running)) { if (!(ap->fw_running)) {
printk(KERN_WARNING "%s: Firmware not running!\n", dev->name); printk(KERN_WARNING "%s: Firmware not running!\n", dev->name);
return -EBUSY; return -EBUSY;
...@@ -2384,8 +2366,8 @@ static int ace_open(struct net_device *dev) ...@@ -2384,8 +2366,8 @@ static int ace_open(struct net_device *dev)
static int ace_close(struct net_device *dev) static int ace_close(struct net_device *dev)
{ {
struct ace_private *ap; struct ace_private *ap = netdev_priv(dev);
struct ace_regs *regs; struct ace_regs __iomem *regs = ap->regs;
struct cmd cmd; struct cmd cmd;
unsigned long flags; unsigned long flags;
short i; short i;
...@@ -2397,9 +2379,7 @@ static int ace_close(struct net_device *dev) ...@@ -2397,9 +2379,7 @@ static int ace_close(struct net_device *dev)
*/ */
netif_stop_queue(dev); netif_stop_queue(dev);
ap = netdev_priv(dev);
regs = ap->regs;
if (ap->promisc) { if (ap->promisc) {
cmd.evt = C_SET_PROMISC_MODE; cmd.evt = C_SET_PROMISC_MODE;
cmd.code = C_C_PROMISC_DISABLE; cmd.code = C_C_PROMISC_DISABLE;
...@@ -2434,9 +2414,11 @@ static int ace_close(struct net_device *dev) ...@@ -2434,9 +2414,11 @@ static int ace_close(struct net_device *dev)
if (mapping) { if (mapping) {
if (ACE_IS_TIGON_I(ap)) { if (ACE_IS_TIGON_I(ap)) {
writel(0, &ap->tx_ring[i].addr.addrhi); struct tx_desc __iomem *tx
writel(0, &ap->tx_ring[i].addr.addrlo); = (struct tx_desc __iomem *) &ap->tx_ring[i];
writel(0, &ap->tx_ring[i].flagsize); writel(0, &tx->addr.addrhi);
writel(0, &tx->addr.addrlo);
writel(0, &tx->flagsize);
} else } else
memset(ap->tx_ring + i, 0, memset(ap->tx_ring + i, 0,
sizeof(struct tx_desc)); sizeof(struct tx_desc));
...@@ -2493,11 +2475,12 @@ ace_load_tx_bd(struct ace_private *ap, struct tx_desc *desc, u64 addr, ...@@ -2493,11 +2475,12 @@ ace_load_tx_bd(struct ace_private *ap, struct tx_desc *desc, u64 addr,
#endif #endif
if (ACE_IS_TIGON_I(ap)) { if (ACE_IS_TIGON_I(ap)) {
writel(addr >> 32, &desc->addr.addrhi); struct tx_desc __iomem *io = (struct tx_desc __iomem *) desc;
writel(addr & 0xffffffff, &desc->addr.addrlo); writel(addr >> 32, &io->addr.addrhi);
writel(flagsize, &desc->flagsize); writel(addr & 0xffffffff, &io->addr.addrlo);
writel(flagsize, &io->flagsize);
#if ACENIC_DO_VLAN #if ACENIC_DO_VLAN
writel(vlan_tag, &desc->vlanres); writel(vlan_tag, &io->vlanres);
#endif #endif
} else { } else {
desc->addr.addrhi = addr >> 32; desc->addr.addrhi = addr >> 32;
...@@ -2513,9 +2496,10 @@ ace_load_tx_bd(struct ace_private *ap, struct tx_desc *desc, u64 addr, ...@@ -2513,9 +2496,10 @@ ace_load_tx_bd(struct ace_private *ap, struct tx_desc *desc, u64 addr,
static int ace_start_xmit(struct sk_buff *skb, struct net_device *dev) static int ace_start_xmit(struct sk_buff *skb, struct net_device *dev)
{ {
struct ace_private *ap = netdev_priv(dev); struct ace_private *ap = netdev_priv(dev);
struct ace_regs *regs = ap->regs; struct ace_regs __iomem *regs = ap->regs;
struct tx_desc *desc; struct tx_desc *desc;
u32 idx, flagsize; u32 idx, flagsize;
unsigned long maxjiff = jiffies + 3*HZ;
restart: restart:
idx = ap->tx_prd; idx = ap->tx_prd;
...@@ -2523,10 +2507,7 @@ static int ace_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -2523,10 +2507,7 @@ static int ace_start_xmit(struct sk_buff *skb, struct net_device *dev)
if (tx_ring_full(ap, ap->tx_ret_csm, idx)) if (tx_ring_full(ap, ap->tx_ret_csm, idx))
goto overflow; goto overflow;
#if MAX_SKB_FRAGS if (!skb_shinfo(skb)->nr_frags) {
if (!skb_shinfo(skb)->nr_frags)
#endif
{
dma_addr_t mapping; dma_addr_t mapping;
u32 vlan_tag = 0; u32 vlan_tag = 0;
...@@ -2548,9 +2529,7 @@ static int ace_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -2548,9 +2529,7 @@ static int ace_start_xmit(struct sk_buff *skb, struct net_device *dev)
flagsize |= BD_FLG_COAL_NOW; flagsize |= BD_FLG_COAL_NOW;
ace_load_tx_bd(ap, desc, mapping, flagsize, vlan_tag); ace_load_tx_bd(ap, desc, mapping, flagsize, vlan_tag);
} } else {
#if MAX_SKB_FRAGS
else {
dma_addr_t mapping; dma_addr_t mapping;
u32 vlan_tag = 0; u32 vlan_tag = 0;
int i, len = 0; int i, len = 0;
...@@ -2605,7 +2584,6 @@ static int ace_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -2605,7 +2584,6 @@ static int ace_start_xmit(struct sk_buff *skb, struct net_device *dev)
ace_load_tx_bd(ap, desc, mapping, flagsize, vlan_tag); ace_load_tx_bd(ap, desc, mapping, flagsize, vlan_tag);
} }
} }
#endif
wmb(); wmb();
ap->tx_prd = idx; ap->tx_prd = idx;
...@@ -2625,7 +2603,7 @@ static int ace_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -2625,7 +2603,7 @@ static int ace_start_xmit(struct sk_buff *skb, struct net_device *dev)
} }
dev->trans_start = jiffies; dev->trans_start = jiffies;
return 0; return NETDEV_TX_OK;
overflow: overflow:
/* /*
...@@ -2644,15 +2622,22 @@ static int ace_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -2644,15 +2622,22 @@ static int ace_start_xmit(struct sk_buff *skb, struct net_device *dev)
* Alternative is to return with 1 not throttling queue. In this * Alternative is to return with 1 not throttling queue. In this
* case loop becomes longer, no more useful effects. * case loop becomes longer, no more useful effects.
*/ */
barrier(); if (time_before(jiffies, maxjiff)) {
goto restart; barrier();
cpu_relax();
goto restart;
}
/* The ring is stuck full. */
printk(KERN_WARNING "%s: Transmit ring stuck full\n", dev->name);
return NETDEV_TX_BUSY;
} }
static int ace_change_mtu(struct net_device *dev, int new_mtu) static int ace_change_mtu(struct net_device *dev, int new_mtu)
{ {
struct ace_private *ap = netdev_priv(dev); struct ace_private *ap = netdev_priv(dev);
struct ace_regs *regs = ap->regs; struct ace_regs __iomem *regs = ap->regs;
if (new_mtu > ACE_JUMBO_MTU) if (new_mtu > ACE_JUMBO_MTU)
return -EINVAL; return -EINVAL;
...@@ -2689,7 +2674,7 @@ static int ace_change_mtu(struct net_device *dev, int new_mtu) ...@@ -2689,7 +2674,7 @@ static int ace_change_mtu(struct net_device *dev, int new_mtu)
static int ace_get_settings(struct net_device *dev, struct ethtool_cmd *ecmd) static int ace_get_settings(struct net_device *dev, struct ethtool_cmd *ecmd)
{ {
struct ace_private *ap = netdev_priv(dev); struct ace_private *ap = netdev_priv(dev);
struct ace_regs *regs = ap->regs; struct ace_regs __iomem *regs = ap->regs;
u32 link; u32 link;
memset(ecmd, 0, sizeof(struct ethtool_cmd)); memset(ecmd, 0, sizeof(struct ethtool_cmd));
...@@ -2742,7 +2727,7 @@ static int ace_get_settings(struct net_device *dev, struct ethtool_cmd *ecmd) ...@@ -2742,7 +2727,7 @@ static int ace_get_settings(struct net_device *dev, struct ethtool_cmd *ecmd)
static int ace_set_settings(struct net_device *dev, struct ethtool_cmd *ecmd) static int ace_set_settings(struct net_device *dev, struct ethtool_cmd *ecmd)
{ {
struct ace_private *ap = netdev_priv(dev); struct ace_private *ap = netdev_priv(dev);
struct ace_regs *regs = ap->regs; struct ace_regs __iomem *regs = ap->regs;
u32 link, speed; u32 link, speed;
link = readl(&regs->GigLnkState); link = readl(&regs->GigLnkState);
...@@ -2822,8 +2807,9 @@ static void ace_get_drvinfo(struct net_device *dev, ...@@ -2822,8 +2807,9 @@ static void ace_get_drvinfo(struct net_device *dev,
*/ */
static int ace_set_mac_addr(struct net_device *dev, void *p) static int ace_set_mac_addr(struct net_device *dev, void *p)
{ {
struct ace_private *ap = netdev_priv(dev);
struct ace_regs __iomem *regs = ap->regs;
struct sockaddr *addr=p; struct sockaddr *addr=p;
struct ace_regs *regs;
u8 *da; u8 *da;
struct cmd cmd; struct cmd cmd;
...@@ -2834,7 +2820,6 @@ static int ace_set_mac_addr(struct net_device *dev, void *p) ...@@ -2834,7 +2820,6 @@ static int ace_set_mac_addr(struct net_device *dev, void *p)
da = (u8 *)dev->dev_addr; da = (u8 *)dev->dev_addr;
regs = ((struct ace_private *)netdev_priv(dev))->regs;
writel(da[0] << 8 | da[1], &regs->MacAddrHi); writel(da[0] << 8 | da[1], &regs->MacAddrHi);
writel((da[2] << 24) | (da[3] << 16) | (da[4] << 8) | da[5], writel((da[2] << 24) | (da[3] << 16) | (da[4] << 8) | da[5],
&regs->MacAddrLo); &regs->MacAddrLo);
...@@ -2851,7 +2836,7 @@ static int ace_set_mac_addr(struct net_device *dev, void *p) ...@@ -2851,7 +2836,7 @@ static int ace_set_mac_addr(struct net_device *dev, void *p)
static void ace_set_multicast_list(struct net_device *dev) static void ace_set_multicast_list(struct net_device *dev)
{ {
struct ace_private *ap = netdev_priv(dev); struct ace_private *ap = netdev_priv(dev);
struct ace_regs *regs = ap->regs; struct ace_regs __iomem *regs = ap->regs;
struct cmd cmd; struct cmd cmd;
if ((dev->flags & IFF_ALLMULTI) && !(ap->mcast_all)) { if ((dev->flags & IFF_ALLMULTI) && !(ap->mcast_all)) {
...@@ -2905,8 +2890,8 @@ static void ace_set_multicast_list(struct net_device *dev) ...@@ -2905,8 +2890,8 @@ static void ace_set_multicast_list(struct net_device *dev)
static struct net_device_stats *ace_get_stats(struct net_device *dev) static struct net_device_stats *ace_get_stats(struct net_device *dev)
{ {
struct ace_private *ap = netdev_priv(dev); struct ace_private *ap = netdev_priv(dev);
struct ace_mac_stats *mac_stats = struct ace_mac_stats __iomem *mac_stats =
(struct ace_mac_stats *)ap->regs->Stats; (struct ace_mac_stats __iomem *)ap->regs->Stats;
ap->stats.rx_missed_errors = readl(&mac_stats->drop_space); ap->stats.rx_missed_errors = readl(&mac_stats->drop_space);
ap->stats.multicast = readl(&mac_stats->kept_mc); ap->stats.multicast = readl(&mac_stats->kept_mc);
...@@ -2916,10 +2901,10 @@ static struct net_device_stats *ace_get_stats(struct net_device *dev) ...@@ -2916,10 +2901,10 @@ static struct net_device_stats *ace_get_stats(struct net_device *dev)
} }
static void __init ace_copy(struct ace_regs *regs, void *src, static void __init ace_copy(struct ace_regs __iomem *regs, void *src,
u32 dest, int size) u32 dest, int size)
{ {
unsigned long tdest; void __iomem *tdest;
u32 *wsrc; u32 *wsrc;
short tsize, i; short tsize, i;
...@@ -2929,7 +2914,7 @@ static void __init ace_copy(struct ace_regs *regs, void *src, ...@@ -2929,7 +2914,7 @@ static void __init ace_copy(struct ace_regs *regs, void *src,
while (size > 0) { while (size > 0) {
tsize = min_t(u32, ((~dest & (ACE_WINDOW_SIZE - 1)) + 1), tsize = min_t(u32, ((~dest & (ACE_WINDOW_SIZE - 1)) + 1),
min_t(u32, size, ACE_WINDOW_SIZE)); min_t(u32, size, ACE_WINDOW_SIZE));
tdest = (unsigned long)&regs->Window + tdest = (void __iomem *) &regs->Window +
(dest & (ACE_WINDOW_SIZE - 1)); (dest & (ACE_WINDOW_SIZE - 1));
writel(dest & ~(ACE_WINDOW_SIZE - 1), &regs->WinBase); writel(dest & ~(ACE_WINDOW_SIZE - 1), &regs->WinBase);
/* /*
...@@ -2949,9 +2934,9 @@ static void __init ace_copy(struct ace_regs *regs, void *src, ...@@ -2949,9 +2934,9 @@ static void __init ace_copy(struct ace_regs *regs, void *src,
} }
static void __init ace_clear(struct ace_regs *regs, u32 dest, int size) static void __init ace_clear(struct ace_regs __iomem *regs, u32 dest, int size)
{ {
unsigned long tdest; void __iomem *tdest;
short tsize = 0, i; short tsize = 0, i;
if (size <= 0) if (size <= 0)
...@@ -2960,7 +2945,7 @@ static void __init ace_clear(struct ace_regs *regs, u32 dest, int size) ...@@ -2960,7 +2945,7 @@ static void __init ace_clear(struct ace_regs *regs, u32 dest, int size)
while (size > 0) { while (size > 0) {
tsize = min_t(u32, ((~dest & (ACE_WINDOW_SIZE - 1)) + 1), tsize = min_t(u32, ((~dest & (ACE_WINDOW_SIZE - 1)) + 1),
min_t(u32, size, ACE_WINDOW_SIZE)); min_t(u32, size, ACE_WINDOW_SIZE));
tdest = (unsigned long)&regs->Window + tdest = (void __iomem *) &regs->Window +
(dest & (ACE_WINDOW_SIZE - 1)); (dest & (ACE_WINDOW_SIZE - 1));
writel(dest & ~(ACE_WINDOW_SIZE - 1), &regs->WinBase); writel(dest & ~(ACE_WINDOW_SIZE - 1), &regs->WinBase);
...@@ -2984,11 +2969,8 @@ static void __init ace_clear(struct ace_regs *regs, u32 dest, int size) ...@@ -2984,11 +2969,8 @@ static void __init ace_clear(struct ace_regs *regs, u32 dest, int size)
*/ */
int __init ace_load_firmware(struct net_device *dev) int __init ace_load_firmware(struct net_device *dev)
{ {
struct ace_private *ap; struct ace_private *ap = netdev_priv(dev);
struct ace_regs *regs; struct ace_regs __iomem *regs = ap->regs;
ap = netdev_priv(dev);
regs = ap->regs;
if (!(readl(&regs->CpuCtrl) & CPU_HALTED)) { if (!(readl(&regs->CpuCtrl) & CPU_HALTED)) {
printk(KERN_ERR "%s: trying to download firmware while the " printk(KERN_ERR "%s: trying to download firmware while the "
...@@ -3036,7 +3018,7 @@ int __init ace_load_firmware(struct net_device *dev) ...@@ -3036,7 +3018,7 @@ int __init ace_load_firmware(struct net_device *dev)
* Thanks to Stevarino Webinski for helping tracking down the bugs in the * Thanks to Stevarino Webinski for helping tracking down the bugs in the
* code i2c readout code by beta testing all my hacks. * code i2c readout code by beta testing all my hacks.
*/ */
static void __init eeprom_start(struct ace_regs *regs) static void __init eeprom_start(struct ace_regs __iomem *regs)
{ {
u32 local; u32 local;
...@@ -3065,7 +3047,7 @@ static void __init eeprom_start(struct ace_regs *regs) ...@@ -3065,7 +3047,7 @@ static void __init eeprom_start(struct ace_regs *regs)
} }
static void __init eeprom_prep(struct ace_regs *regs, u8 magic) static void __init eeprom_prep(struct ace_regs __iomem *regs, u8 magic)
{ {
short i; short i;
u32 local; u32 local;
...@@ -3102,7 +3084,7 @@ static void __init eeprom_prep(struct ace_regs *regs, u8 magic) ...@@ -3102,7 +3084,7 @@ static void __init eeprom_prep(struct ace_regs *regs, u8 magic)
} }
static int __init eeprom_check_ack(struct ace_regs *regs) static int __init eeprom_check_ack(struct ace_regs __iomem *regs)
{ {
int state; int state;
u32 local; u32 local;
...@@ -3130,7 +3112,7 @@ static int __init eeprom_check_ack(struct ace_regs *regs) ...@@ -3130,7 +3112,7 @@ static int __init eeprom_check_ack(struct ace_regs *regs)
} }
static void __init eeprom_stop(struct ace_regs *regs) static void __init eeprom_stop(struct ace_regs __iomem *regs)
{ {
u32 local; u32 local;
...@@ -3168,8 +3150,8 @@ static void __init eeprom_stop(struct ace_regs *regs) ...@@ -3168,8 +3150,8 @@ static void __init eeprom_stop(struct ace_regs *regs)
static int __init read_eeprom_byte(struct net_device *dev, static int __init read_eeprom_byte(struct net_device *dev,
unsigned long offset) unsigned long offset)
{ {
struct ace_private *ap; struct ace_private *ap = netdev_priv(dev);
struct ace_regs *regs; struct ace_regs __iomem *regs = ap->regs;
unsigned long flags; unsigned long flags;
u32 local; u32 local;
int result = 0; int result = 0;
...@@ -3181,9 +3163,6 @@ static int __init read_eeprom_byte(struct net_device *dev, ...@@ -3181,9 +3163,6 @@ static int __init read_eeprom_byte(struct net_device *dev,
goto out; goto out;
} }
ap = netdev_priv(dev);
regs = ap->regs;
/* /*
* Don't take interrupts on this CPU will bit banging * Don't take interrupts on this CPU will bit banging
* the %#%#@$ I2C device * the %#%#@$ I2C device
......
...@@ -10,11 +10,6 @@ ...@@ -10,11 +10,6 @@
*/ */
#define USE_TX_COAL_NOW 0 #define USE_TX_COAL_NOW 0
#ifndef MAX_SKB_FRAGS
#define MAX_SKB_FRAGS 0
#endif
/* /*
* Addressing: * Addressing:
* *
...@@ -638,7 +633,7 @@ struct ace_skb ...@@ -638,7 +633,7 @@ struct ace_skb
struct ace_private struct ace_private
{ {
struct ace_info *info; struct ace_info *info;
struct ace_regs *regs; /* register base */ struct ace_regs __iomem *regs; /* register base */
struct ace_skb *skb; struct ace_skb *skb;
dma_addr_t info_dma; /* 32/64 bit */ dma_addr_t info_dma; /* 32/64 bit */
...@@ -712,13 +707,7 @@ static inline int tx_space (struct ace_private *ap, u32 csm, u32 prd) ...@@ -712,13 +707,7 @@ static inline int tx_space (struct ace_private *ap, u32 csm, u32 prd)
} }
#define tx_free(ap) tx_space((ap)->tx_ret_csm, (ap)->tx_prd, ap) #define tx_free(ap) tx_space((ap)->tx_ret_csm, (ap)->tx_prd, ap)
#if MAX_SKB_FRAGS
#define tx_ring_full(ap, csm, prd) (tx_space(ap, csm, prd) <= TX_RESERVED) #define tx_ring_full(ap, csm, prd) (tx_space(ap, csm, prd) <= TX_RESERVED)
#else
#define tx_ring_full 0
#endif
static inline void set_aceaddr(aceaddr *aa, dma_addr_t addr) static inline void set_aceaddr(aceaddr *aa, dma_addr_t addr)
{ {
...@@ -729,7 +718,7 @@ static inline void set_aceaddr(aceaddr *aa, dma_addr_t addr) ...@@ -729,7 +718,7 @@ static inline void set_aceaddr(aceaddr *aa, dma_addr_t addr)
} }
static inline void ace_set_txprd(struct ace_regs *regs, static inline void ace_set_txprd(struct ace_regs __iomem *regs,
struct ace_private *ap, u32 value) struct ace_private *ap, u32 value)
{ {
#ifdef INDEX_DEBUG #ifdef INDEX_DEBUG
...@@ -750,8 +739,8 @@ static inline void ace_set_txprd(struct ace_regs *regs, ...@@ -750,8 +739,8 @@ static inline void ace_set_txprd(struct ace_regs *regs,
static inline void ace_mask_irq(struct net_device *dev) static inline void ace_mask_irq(struct net_device *dev)
{ {
struct ace_private *ap = dev->priv; struct ace_private *ap = netdev_priv(dev);
struct ace_regs *regs = ap->regs; struct ace_regs __iomem *regs = ap->regs;
if (ACE_IS_TIGON_I(ap)) if (ACE_IS_TIGON_I(ap))
writel(1, &regs->MaskInt); writel(1, &regs->MaskInt);
...@@ -764,8 +753,8 @@ static inline void ace_mask_irq(struct net_device *dev) ...@@ -764,8 +753,8 @@ static inline void ace_mask_irq(struct net_device *dev)
static inline void ace_unmask_irq(struct net_device *dev) static inline void ace_unmask_irq(struct net_device *dev)
{ {
struct ace_private *ap = dev->priv; struct ace_private *ap = netdev_priv(dev);
struct ace_regs *regs = ap->regs; struct ace_regs __iomem *regs = ap->regs;
if (ACE_IS_TIGON_I(ap)) if (ACE_IS_TIGON_I(ap))
writel(0, &regs->MaskInt); writel(0, &regs->MaskInt);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment