Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 906da809 authored by Olof Johansson's avatar Olof Johansson Committed by Linus Torvalds
Browse files

pcmcia: replace kio_addr_t with unsigned int everywhere



Remove kio_addr_t, and replace it with unsigned int.  No known architecture
needs more than 32 bits for IO addresses and ports and having a separate type
for it is just messy.

Signed-off-by: default avatarOlof Johansson <olof@lixom.net>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Matthew Wilcox <matthew@wil.cx>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Dominik Brodowski <linux@dominikbrodowski.net>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent ecb8a847
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -33,8 +33,8 @@ This file details changes in 2.6 which affect PCMCIA card driver authors:
   and can be used (e.g. for SET_NETDEV_DEV) by using
   handle_to_dev(client_handle_t * handle).

* Convert internal I/O port addresses to unsigned long (as of 2.6.11)
   ioaddr_t should be replaced by kio_addr_t in PCMCIA card drivers.
* Convert internal I/O port addresses to unsigned int (as of 2.6.11)
   ioaddr_t should be replaced by unsigned int in PCMCIA card drivers.

* irq_mask and irq_list parameters (as of 2.6.11)
   The irq_mask and irq_list parameters should no longer be used in
+1 −1
Original line number Diff line number Diff line
@@ -704,7 +704,7 @@ static int next_tuple(struct pcmcia_device *handle, tuple_t *tuple, cisparse_t *

static int bt3c_config(struct pcmcia_device *link)
{
	static kio_addr_t base[5] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8, 0x0 };
	static unsigned int base[5] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8, 0x0 };
	bt3c_info_t *info = link->priv;
	tuple_t tuple;
	u_short buf[256];
+1 −1
Original line number Diff line number Diff line
@@ -634,7 +634,7 @@ static int next_tuple(struct pcmcia_device *handle, tuple_t *tuple, cisparse_t *

static int btuart_config(struct pcmcia_device *link)
{
	static kio_addr_t base[5] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8, 0x0 };
	static unsigned int base[5] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8, 0x0 };
	btuart_info_t *info = link->priv;
	tuple_t tuple;
	u_short buf[256];
+25 −24
Original line number Diff line number Diff line
@@ -230,10 +230,11 @@ static char mii_preamble_required = 0;
static int tc574_config(struct pcmcia_device *link);
static void tc574_release(struct pcmcia_device *link);

static void mdio_sync(kio_addr_t ioaddr, int bits);
static int mdio_read(kio_addr_t ioaddr, int phy_id, int location);
static void mdio_write(kio_addr_t ioaddr, int phy_id, int location, int value);
static unsigned short read_eeprom(kio_addr_t ioaddr, int index);
static void mdio_sync(unsigned int ioaddr, int bits);
static int mdio_read(unsigned int ioaddr, int phy_id, int location);
static void mdio_write(unsigned int ioaddr, int phy_id, int location,
		       int value);
static unsigned short read_eeprom(unsigned int ioaddr, int index);
static void tc574_wait_for_completion(struct net_device *dev, int cmd);

static void tc574_reset(struct net_device *dev);
@@ -341,7 +342,7 @@ static int tc574_config(struct pcmcia_device *link)
	tuple_t tuple;
	__le16 buf[32];
	int last_fn, last_ret, i, j;
	kio_addr_t ioaddr;
	unsigned int ioaddr;
	__be16 *phys_addr;
	char *cardname;
	__u32 config;
@@ -515,7 +516,7 @@ static int tc574_resume(struct pcmcia_device *link)

static void dump_status(struct net_device *dev)
{
	kio_addr_t ioaddr = dev->base_addr;
	unsigned int ioaddr = dev->base_addr;
	EL3WINDOW(1);
	printk(KERN_INFO "  irq status %04x, rx status %04x, tx status "
		   "%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)
/* Read a word from the EEPROM using the regular EEPROM access register.
   Assume that we are in register window zero.
 */
static unsigned short read_eeprom(kio_addr_t ioaddr, int index)
static unsigned short read_eeprom(unsigned int ioaddr, int index)
{
	int timer;
	outw(EEPROM_Read + index, ioaddr + Wn0EepromCmd);
@@ -572,9 +573,9 @@ static unsigned short read_eeprom(kio_addr_t ioaddr, int index)

/* Generate the preamble required for initial synchronization and
   a few older transceivers. */
static void mdio_sync(kio_addr_t ioaddr, int bits)
static void mdio_sync(unsigned int ioaddr, int bits)
{
	kio_addr_t mdio_addr = ioaddr + Wn4_PhysicalMgmt;
	unsigned int mdio_addr = ioaddr + Wn4_PhysicalMgmt;

	/* Establish sync by sending at least 32 logic ones. */
	while (-- bits >= 0) {
@@ -583,12 +584,12 @@ static void mdio_sync(kio_addr_t ioaddr, int bits)
	}
}

static int mdio_read(kio_addr_t ioaddr, int phy_id, int location)
static int mdio_read(unsigned int ioaddr, int phy_id, int location)
{
	int i;
	int read_cmd = (0xf6 << 10) | (phy_id << 5) | location;
	unsigned int retval = 0;
	kio_addr_t mdio_addr = ioaddr + Wn4_PhysicalMgmt;
	unsigned int mdio_addr = ioaddr + Wn4_PhysicalMgmt;

	if (mii_preamble_required)
		mdio_sync(ioaddr, 32);
@@ -608,10 +609,10 @@ static int mdio_read(kio_addr_t ioaddr, int phy_id, int location)
	return (retval>>1) & 0xffff;
}

static void mdio_write(kio_addr_t ioaddr, int phy_id, int location, int value)
static void mdio_write(unsigned int ioaddr, int phy_id, int location, int value)
{
	int write_cmd = 0x50020000 | (phy_id << 23) | (location << 18) | value;
	kio_addr_t mdio_addr = ioaddr + Wn4_PhysicalMgmt;
	unsigned int mdio_addr = ioaddr + Wn4_PhysicalMgmt;
	int i;

	if (mii_preamble_required)
@@ -637,7 +638,7 @@ static void tc574_reset(struct net_device *dev)
{
	struct el3_private *lp = netdev_priv(dev);
	int i;
	kio_addr_t ioaddr = dev->base_addr;
	unsigned int ioaddr = dev->base_addr;
	unsigned long flags;

	tc574_wait_for_completion(dev, TotalReset|0x10);
@@ -741,7 +742,7 @@ static int el3_open(struct net_device *dev)
static void el3_tx_timeout(struct net_device *dev)
{
	struct el3_private *lp = netdev_priv(dev);
	kio_addr_t ioaddr = dev->base_addr;
	unsigned int ioaddr = dev->base_addr;
	
	printk(KERN_NOTICE "%s: Transmit timed out!\n", dev->name);
	dump_status(dev);
@@ -756,7 +757,7 @@ static void el3_tx_timeout(struct net_device *dev)
static void pop_tx_status(struct net_device *dev)
{
	struct el3_private *lp = netdev_priv(dev);
	kio_addr_t ioaddr = dev->base_addr;
	unsigned int ioaddr = dev->base_addr;
	int i;
    
	/* Clear the Tx status stack. */
@@ -779,7 +780,7 @@ static void pop_tx_status(struct net_device *dev)

static int el3_start_xmit(struct sk_buff *skb, struct net_device *dev)
{
	kio_addr_t ioaddr = dev->base_addr;
	unsigned int ioaddr = dev->base_addr;
	struct el3_private *lp = netdev_priv(dev);
	unsigned long flags;

@@ -813,7 +814,7 @@ static irqreturn_t el3_interrupt(int irq, void *dev_id)
{
	struct net_device *dev = (struct net_device *) dev_id;
	struct el3_private *lp = netdev_priv(dev);
	kio_addr_t ioaddr;
	unsigned int ioaddr;
	unsigned status;
	int work_budget = max_interrupt_work;
	int handled = 0;
@@ -907,7 +908,7 @@ static void media_check(unsigned long arg)
{
	struct net_device *dev = (struct net_device *) arg;
	struct el3_private *lp = netdev_priv(dev);
	kio_addr_t ioaddr = dev->base_addr;
	unsigned int ioaddr = dev->base_addr;
	unsigned long flags;
	unsigned short /* cable, */ media, partner;

@@ -996,7 +997,7 @@ static struct net_device_stats *el3_get_stats(struct net_device *dev)
static void update_stats(struct net_device *dev)
{
	struct el3_private *lp = netdev_priv(dev);
	kio_addr_t ioaddr = dev->base_addr;
	unsigned int ioaddr = dev->base_addr;
	u8 rx, tx, up;

	DEBUG(2, "%s: updating the statistics.\n", dev->name);
@@ -1033,7 +1034,7 @@ static void update_stats(struct net_device *dev)
static int el3_rx(struct net_device *dev, int worklimit)
{
	struct el3_private *lp = netdev_priv(dev);
	kio_addr_t ioaddr = dev->base_addr;
	unsigned int ioaddr = dev->base_addr;
	short rx_status;
	
	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 = {
static int el3_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
{
	struct el3_private *lp = netdev_priv(dev);
	kio_addr_t ioaddr = dev->base_addr;
	unsigned int ioaddr = dev->base_addr;
	u16 *data = (u16 *)&rq->ifr_ifru;
	int phy = lp->phys & 0x1f;

@@ -1148,7 +1149,7 @@ static int el3_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)

static void set_rx_mode(struct net_device *dev)
{
	kio_addr_t ioaddr = dev->base_addr;
	unsigned int ioaddr = dev->base_addr;

	if (dev->flags & IFF_PROMISC)
		outw(SetRxFilter | RxStation | RxMulticast | RxBroadcast | RxProm,
@@ -1161,7 +1162,7 @@ static void set_rx_mode(struct net_device *dev)

static int el3_close(struct net_device *dev)
{
	kio_addr_t ioaddr = dev->base_addr;
	unsigned int ioaddr = dev->base_addr;
	struct el3_private *lp = netdev_priv(dev);
	struct pcmcia_device *link = lp->p_dev;

+15 −15
Original line number Diff line number Diff line
@@ -145,7 +145,7 @@ DRV_NAME ".c " DRV_VERSION " 2001/10/13 00:08:50 (David Hinds)";
static int tc589_config(struct pcmcia_device *link);
static void tc589_release(struct pcmcia_device *link);

static u16 read_eeprom(kio_addr_t ioaddr, int index);
static u16 read_eeprom(unsigned int ioaddr, int index);
static void tc589_reset(struct net_device *dev);
static void media_check(unsigned long arg);
static int el3_config(struct net_device *dev, struct ifmap *map);
@@ -254,7 +254,7 @@ static int tc589_config(struct pcmcia_device *link)
    __le16 buf[32];
    __be16 *phys_addr;
    int last_fn, last_ret, i, j, multi = 0, fifo;
    kio_addr_t ioaddr;
    unsigned int ioaddr;
    char *ram_split[] = {"5:3", "3:1", "1:1", "3:5"};
    DECLARE_MAC_BUF(mac);
    
@@ -403,7 +403,7 @@ static void tc589_wait_for_completion(struct net_device *dev, int cmd)
  Read a word from the EEPROM using the regular EEPROM access register.
  Assume that we are in register window zero.
*/
static u16 read_eeprom(kio_addr_t ioaddr, int index)
static u16 read_eeprom(unsigned int ioaddr, int index)
{
    int i;
    outw(EEPROM_READ + index, ioaddr + 10);
@@ -421,7 +421,7 @@ static u16 read_eeprom(kio_addr_t ioaddr, int index)
static void tc589_set_xcvr(struct net_device *dev, int if_port)
{
    struct el3_private *lp = netdev_priv(dev);
    kio_addr_t ioaddr = dev->base_addr;
    unsigned int ioaddr = dev->base_addr;
    
    EL3WINDOW(0);
    switch (if_port) {
@@ -443,7 +443,7 @@ static void tc589_set_xcvr(struct net_device *dev, int if_port)

static void dump_status(struct net_device *dev)
{
    kio_addr_t ioaddr = dev->base_addr;
    unsigned int ioaddr = dev->base_addr;
    EL3WINDOW(1);
    printk(KERN_INFO "  irq status %04x, rx status %04x, tx status "
	   "%02x  tx free %04x\n", inw(ioaddr+EL3_STATUS),
@@ -459,7 +459,7 @@ static void dump_status(struct net_device *dev)
/* Reset and restore all of the 3c589 registers. */
static void tc589_reset(struct net_device *dev)
{
    kio_addr_t ioaddr = dev->base_addr;
    unsigned int ioaddr = dev->base_addr;
    int i;
    
    EL3WINDOW(0);
@@ -567,7 +567,7 @@ static int el3_open(struct net_device *dev)
static void el3_tx_timeout(struct net_device *dev)
{
    struct el3_private *lp = netdev_priv(dev);
    kio_addr_t ioaddr = dev->base_addr;
    unsigned int ioaddr = dev->base_addr;
    
    printk(KERN_WARNING "%s: Transmit timed out!\n", dev->name);
    dump_status(dev);
@@ -582,7 +582,7 @@ static void el3_tx_timeout(struct net_device *dev)
static void pop_tx_status(struct net_device *dev)
{
    struct el3_private *lp = netdev_priv(dev);
    kio_addr_t ioaddr = dev->base_addr;
    unsigned int ioaddr = dev->base_addr;
    int i;
    
    /* Clear the Tx status stack. */
@@ -604,7 +604,7 @@ static void pop_tx_status(struct net_device *dev)

static int el3_start_xmit(struct sk_buff *skb, struct net_device *dev)
{
    kio_addr_t ioaddr = dev->base_addr;
    unsigned int ioaddr = dev->base_addr;
    struct el3_private *priv = netdev_priv(dev);
    unsigned long flags;

@@ -641,7 +641,7 @@ static irqreturn_t el3_interrupt(int irq, void *dev_id)
{
    struct net_device *dev = (struct net_device *) dev_id;
    struct el3_private *lp = netdev_priv(dev);
    kio_addr_t ioaddr;
    unsigned int ioaddr;
    __u16 status;
    int i = 0, handled = 1;
    
@@ -727,7 +727,7 @@ static void media_check(unsigned long arg)
{
    struct net_device *dev = (struct net_device *)(arg);
    struct el3_private *lp = netdev_priv(dev);
    kio_addr_t ioaddr = dev->base_addr;
    unsigned int ioaddr = dev->base_addr;
    u16 media, errs;
    unsigned long flags;

@@ -828,7 +828,7 @@ static struct net_device_stats *el3_get_stats(struct net_device *dev)
static void update_stats(struct net_device *dev)
{
    struct el3_private *lp = netdev_priv(dev);
    kio_addr_t ioaddr = dev->base_addr;
    unsigned int ioaddr = dev->base_addr;

    DEBUG(2, "%s: updating the statistics.\n", dev->name);
    /* Turn off statistics updates while reading. */
@@ -855,7 +855,7 @@ static void update_stats(struct net_device *dev)
static int el3_rx(struct net_device *dev)
{
    struct el3_private *lp = netdev_priv(dev);
    kio_addr_t ioaddr = dev->base_addr;
    unsigned int ioaddr = dev->base_addr;
    int worklimit = 32;
    short rx_status;
    
@@ -909,7 +909,7 @@ static void set_multicast_list(struct net_device *dev)
{
    struct el3_private *lp = netdev_priv(dev);
    struct pcmcia_device *link = lp->p_dev;
    kio_addr_t ioaddr = dev->base_addr;
    unsigned int ioaddr = dev->base_addr;
    u16 opts = SetRxFilter | RxStation | RxBroadcast;

    if (!pcmcia_dev_present(link)) return;
@@ -924,7 +924,7 @@ static int el3_close(struct net_device *dev)
{
    struct el3_private *lp = netdev_priv(dev);
    struct pcmcia_device *link = lp->p_dev;
    kio_addr_t ioaddr = dev->base_addr;
    unsigned int ioaddr = dev->base_addr;
    
    DEBUG(1, "%s: shutting down ethercard.\n", dev->name);

Loading