diff options
Diffstat (limited to 'drivers/net/pcmcia/3c574_cs.c')
-rw-r--r-- | drivers/net/pcmcia/3c574_cs.c | 49 |
1 files changed, 25 insertions, 24 deletions
diff --git a/drivers/net/pcmcia/3c574_cs.c b/drivers/net/pcmcia/3c574_cs.c index 36a7ba3134ce..dafbbdbc4bf7 100644 --- a/drivers/net/pcmcia/3c574_cs.c +++ b/drivers/net/pcmcia/3c574_cs.c | |||
@@ -230,10 +230,11 @@ static char mii_preamble_required = 0; | |||
230 | static int tc574_config(struct pcmcia_device *link); | 230 | static int tc574_config(struct pcmcia_device *link); |
231 | static void tc574_release(struct pcmcia_device *link); | 231 | static void tc574_release(struct pcmcia_device *link); |
232 | 232 | ||
233 | static void mdio_sync(kio_addr_t ioaddr, int bits); | 233 | static void mdio_sync(unsigned int ioaddr, int bits); |
234 | static int mdio_read(kio_addr_t ioaddr, int phy_id, int location); | 234 | static int mdio_read(unsigned int ioaddr, int phy_id, int location); |
235 | static void mdio_write(kio_addr_t ioaddr, int phy_id, int location, int value); | 235 | static void mdio_write(unsigned int ioaddr, int phy_id, int location, |
236 | static unsigned short read_eeprom(kio_addr_t ioaddr, int index); | 236 | int value); |
237 | static unsigned short read_eeprom(unsigned int ioaddr, int index); | ||
237 | static void tc574_wait_for_completion(struct net_device *dev, int cmd); | 238 | static void tc574_wait_for_completion(struct net_device *dev, int cmd); |
238 | 239 | ||
239 | static void tc574_reset(struct net_device *dev); | 240 | static void tc574_reset(struct net_device *dev); |
@@ -341,7 +342,7 @@ static int tc574_config(struct pcmcia_device *link) | |||
341 | tuple_t tuple; | 342 | tuple_t tuple; |
342 | __le16 buf[32]; | 343 | __le16 buf[32]; |
343 | int last_fn, last_ret, i, j; | 344 | int last_fn, last_ret, i, j; |
344 | kio_addr_t ioaddr; | 345 | unsigned int ioaddr; |
345 | __be16 *phys_addr; | 346 | __be16 *phys_addr; |
346 | char *cardname; | 347 | char *cardname; |
347 | __u32 config; | 348 | __u32 config; |
@@ -515,7 +516,7 @@ static int tc574_resume(struct pcmcia_device *link) | |||
515 | 516 | ||
516 | static void dump_status(struct net_device *dev) | 517 | static void dump_status(struct net_device *dev) |
517 | { | 518 | { |
518 | kio_addr_t ioaddr = dev->base_addr; | 519 | unsigned int ioaddr = dev->base_addr; |
519 | EL3WINDOW(1); | 520 | EL3WINDOW(1); |
520 | printk(KERN_INFO " irq status %04x, rx status %04x, tx status " | 521 | printk(KERN_INFO " irq status %04x, rx status %04x, tx status " |
521 | "%02x, tx free %04x\n", inw(ioaddr+EL3_STATUS), | 522 | "%02x, tx free %04x\n", inw(ioaddr+EL3_STATUS), |
@@ -544,7 +545,7 @@ static void tc574_wait_for_completion(struct net_device *dev, int cmd) | |||
544 | /* Read a word from the EEPROM using the regular EEPROM access register. | 545 | /* Read a word from the EEPROM using the regular EEPROM access register. |
545 | Assume that we are in register window zero. | 546 | Assume that we are in register window zero. |
546 | */ | 547 | */ |
547 | static unsigned short read_eeprom(kio_addr_t ioaddr, int index) | 548 | static unsigned short read_eeprom(unsigned int ioaddr, int index) |
548 | { | 549 | { |
549 | int timer; | 550 | int timer; |
550 | outw(EEPROM_Read + index, ioaddr + Wn0EepromCmd); | 551 | outw(EEPROM_Read + index, ioaddr + Wn0EepromCmd); |
@@ -572,9 +573,9 @@ static unsigned short read_eeprom(kio_addr_t ioaddr, int index) | |||
572 | 573 | ||
573 | /* Generate the preamble required for initial synchronization and | 574 | /* Generate the preamble required for initial synchronization and |
574 | a few older transceivers. */ | 575 | a few older transceivers. */ |
575 | static void mdio_sync(kio_addr_t ioaddr, int bits) | 576 | static void mdio_sync(unsigned int ioaddr, int bits) |
576 | { | 577 | { |
577 | kio_addr_t mdio_addr = ioaddr + Wn4_PhysicalMgmt; | 578 | unsigned int mdio_addr = ioaddr + Wn4_PhysicalMgmt; |
578 | 579 | ||
579 | /* Establish sync by sending at least 32 logic ones. */ | 580 | /* Establish sync by sending at least 32 logic ones. */ |
580 | while (-- bits >= 0) { | 581 | while (-- bits >= 0) { |
@@ -583,12 +584,12 @@ static void mdio_sync(kio_addr_t ioaddr, int bits) | |||
583 | } | 584 | } |
584 | } | 585 | } |
585 | 586 | ||
586 | static int mdio_read(kio_addr_t ioaddr, int phy_id, int location) | 587 | static int mdio_read(unsigned int ioaddr, int phy_id, int location) |
587 | { | 588 | { |
588 | int i; | 589 | int i; |
589 | int read_cmd = (0xf6 << 10) | (phy_id << 5) | location; | 590 | int read_cmd = (0xf6 << 10) | (phy_id << 5) | location; |
590 | unsigned int retval = 0; | 591 | unsigned int retval = 0; |
591 | kio_addr_t mdio_addr = ioaddr + Wn4_PhysicalMgmt; | 592 | unsigned int mdio_addr = ioaddr + Wn4_PhysicalMgmt; |
592 | 593 | ||
593 | if (mii_preamble_required) | 594 | if (mii_preamble_required) |
594 | mdio_sync(ioaddr, 32); | 595 | mdio_sync(ioaddr, 32); |
@@ -608,10 +609,10 @@ static int mdio_read(kio_addr_t ioaddr, int phy_id, int location) | |||
608 | return (retval>>1) & 0xffff; | 609 | return (retval>>1) & 0xffff; |
609 | } | 610 | } |
610 | 611 | ||
611 | static void mdio_write(kio_addr_t ioaddr, int phy_id, int location, int value) | 612 | static void mdio_write(unsigned int ioaddr, int phy_id, int location, int value) |
612 | { | 613 | { |
613 | int write_cmd = 0x50020000 | (phy_id << 23) | (location << 18) | value; | 614 | int write_cmd = 0x50020000 | (phy_id << 23) | (location << 18) | value; |
614 | kio_addr_t mdio_addr = ioaddr + Wn4_PhysicalMgmt; | 615 | unsigned int mdio_addr = ioaddr + Wn4_PhysicalMgmt; |
615 | int i; | 616 | int i; |
616 | 617 | ||
617 | if (mii_preamble_required) | 618 | if (mii_preamble_required) |
@@ -637,7 +638,7 @@ static void tc574_reset(struct net_device *dev) | |||
637 | { | 638 | { |
638 | struct el3_private *lp = netdev_priv(dev); | 639 | struct el3_private *lp = netdev_priv(dev); |
639 | int i; | 640 | int i; |
640 | kio_addr_t ioaddr = dev->base_addr; | 641 | unsigned int ioaddr = dev->base_addr; |
641 | unsigned long flags; | 642 | unsigned long flags; |
642 | 643 | ||
643 | tc574_wait_for_completion(dev, TotalReset|0x10); | 644 | tc574_wait_for_completion(dev, TotalReset|0x10); |
@@ -741,7 +742,7 @@ static int el3_open(struct net_device *dev) | |||
741 | static void el3_tx_timeout(struct net_device *dev) | 742 | static void el3_tx_timeout(struct net_device *dev) |
742 | { | 743 | { |
743 | struct el3_private *lp = netdev_priv(dev); | 744 | struct el3_private *lp = netdev_priv(dev); |
744 | kio_addr_t ioaddr = dev->base_addr; | 745 | unsigned int ioaddr = dev->base_addr; |
745 | 746 | ||
746 | printk(KERN_NOTICE "%s: Transmit timed out!\n", dev->name); | 747 | printk(KERN_NOTICE "%s: Transmit timed out!\n", dev->name); |
747 | dump_status(dev); | 748 | dump_status(dev); |
@@ -756,7 +757,7 @@ static void el3_tx_timeout(struct net_device *dev) | |||
756 | static void pop_tx_status(struct net_device *dev) | 757 | static void pop_tx_status(struct net_device *dev) |
757 | { | 758 | { |
758 | struct el3_private *lp = netdev_priv(dev); | 759 | struct el3_private *lp = netdev_priv(dev); |
759 | kio_addr_t ioaddr = dev->base_addr; | 760 | unsigned int ioaddr = dev->base_addr; |
760 | int i; | 761 | int i; |
761 | 762 | ||
762 | /* Clear the Tx status stack. */ | 763 | /* Clear the Tx status stack. */ |
@@ -779,7 +780,7 @@ static void pop_tx_status(struct net_device *dev) | |||
779 | 780 | ||
780 | static int el3_start_xmit(struct sk_buff *skb, struct net_device *dev) | 781 | static int el3_start_xmit(struct sk_buff *skb, struct net_device *dev) |
781 | { | 782 | { |
782 | kio_addr_t ioaddr = dev->base_addr; | 783 | unsigned int ioaddr = dev->base_addr; |
783 | struct el3_private *lp = netdev_priv(dev); | 784 | struct el3_private *lp = netdev_priv(dev); |
784 | unsigned long flags; | 785 | unsigned long flags; |
785 | 786 | ||
@@ -813,7 +814,7 @@ static irqreturn_t el3_interrupt(int irq, void *dev_id) | |||
813 | { | 814 | { |
814 | struct net_device *dev = (struct net_device *) dev_id; | 815 | struct net_device *dev = (struct net_device *) dev_id; |
815 | struct el3_private *lp = netdev_priv(dev); | 816 | struct el3_private *lp = netdev_priv(dev); |
816 | kio_addr_t ioaddr; | 817 | unsigned int ioaddr; |
817 | unsigned status; | 818 | unsigned status; |
818 | int work_budget = max_interrupt_work; | 819 | int work_budget = max_interrupt_work; |
819 | int handled = 0; | 820 | int handled = 0; |
@@ -907,7 +908,7 @@ static void media_check(unsigned long arg) | |||
907 | { | 908 | { |
908 | struct net_device *dev = (struct net_device *) arg; | 909 | struct net_device *dev = (struct net_device *) arg; |
909 | struct el3_private *lp = netdev_priv(dev); | 910 | struct el3_private *lp = netdev_priv(dev); |
910 | kio_addr_t ioaddr = dev->base_addr; | 911 | unsigned int ioaddr = dev->base_addr; |
911 | unsigned long flags; | 912 | unsigned long flags; |
912 | unsigned short /* cable, */ media, partner; | 913 | unsigned short /* cable, */ media, partner; |
913 | 914 | ||
@@ -996,7 +997,7 @@ static struct net_device_stats *el3_get_stats(struct net_device *dev) | |||
996 | static void update_stats(struct net_device *dev) | 997 | static void update_stats(struct net_device *dev) |
997 | { | 998 | { |
998 | struct el3_private *lp = netdev_priv(dev); | 999 | struct el3_private *lp = netdev_priv(dev); |
999 | kio_addr_t ioaddr = dev->base_addr; | 1000 | unsigned int ioaddr = dev->base_addr; |
1000 | u8 rx, tx, up; | 1001 | u8 rx, tx, up; |
1001 | 1002 | ||
1002 | DEBUG(2, "%s: updating the statistics.\n", dev->name); | 1003 | DEBUG(2, "%s: updating the statistics.\n", dev->name); |
@@ -1033,7 +1034,7 @@ static void update_stats(struct net_device *dev) | |||
1033 | static int el3_rx(struct net_device *dev, int worklimit) | 1034 | static int el3_rx(struct net_device *dev, int worklimit) |
1034 | { | 1035 | { |
1035 | struct el3_private *lp = netdev_priv(dev); | 1036 | struct el3_private *lp = netdev_priv(dev); |
1036 | kio_addr_t ioaddr = dev->base_addr; | 1037 | unsigned int ioaddr = dev->base_addr; |
1037 | short rx_status; | 1038 | short rx_status; |
1038 | 1039 | ||
1039 | DEBUG(3, "%s: in rx_packet(), status %4.4x, rx_status %4.4x.\n", | 1040 | DEBUG(3, "%s: in rx_packet(), status %4.4x, rx_status %4.4x.\n", |
@@ -1094,7 +1095,7 @@ static const struct ethtool_ops netdev_ethtool_ops = { | |||
1094 | static int el3_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) | 1095 | static int el3_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) |
1095 | { | 1096 | { |
1096 | struct el3_private *lp = netdev_priv(dev); | 1097 | struct el3_private *lp = netdev_priv(dev); |
1097 | kio_addr_t ioaddr = dev->base_addr; | 1098 | unsigned int ioaddr = dev->base_addr; |
1098 | u16 *data = (u16 *)&rq->ifr_ifru; | 1099 | u16 *data = (u16 *)&rq->ifr_ifru; |
1099 | int phy = lp->phys & 0x1f; | 1100 | int phy = lp->phys & 0x1f; |
1100 | 1101 | ||
@@ -1148,7 +1149,7 @@ static int el3_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) | |||
1148 | 1149 | ||
1149 | static void set_rx_mode(struct net_device *dev) | 1150 | static void set_rx_mode(struct net_device *dev) |
1150 | { | 1151 | { |
1151 | kio_addr_t ioaddr = dev->base_addr; | 1152 | unsigned int ioaddr = dev->base_addr; |
1152 | 1153 | ||
1153 | if (dev->flags & IFF_PROMISC) | 1154 | if (dev->flags & IFF_PROMISC) |
1154 | outw(SetRxFilter | RxStation | RxMulticast | RxBroadcast | RxProm, | 1155 | outw(SetRxFilter | RxStation | RxMulticast | RxBroadcast | RxProm, |
@@ -1161,7 +1162,7 @@ static void set_rx_mode(struct net_device *dev) | |||
1161 | 1162 | ||
1162 | static int el3_close(struct net_device *dev) | 1163 | static int el3_close(struct net_device *dev) |
1163 | { | 1164 | { |
1164 | kio_addr_t ioaddr = dev->base_addr; | 1165 | unsigned int ioaddr = dev->base_addr; |
1165 | struct el3_private *lp = netdev_priv(dev); | 1166 | struct el3_private *lp = netdev_priv(dev); |
1166 | struct pcmcia_device *link = lp->p_dev; | 1167 | struct pcmcia_device *link = lp->p_dev; |
1167 | 1168 | ||