diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-21 14:25:16 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-21 14:25:16 -0700 |
commit | b65378898c2eefb20f419632c1199bc0592e2f79 (patch) | |
tree | 052bb72d329c44790f91fc8097b8500d4774d02c /drivers/net/pcmcia/ibmtr_cs.c | |
parent | 157b6ceb13e4b4148ee03dd517dbe88748943125 (diff) | |
parent | 5b917a1420d3d1a9c8da49fb0090692dc9aaee86 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6: (22 commits)
pcmcia: synclink_cs: fix information leak to userland
pcmcia: don't call flush_scheduled_work() spuriously
serial_cs: drop spurious flush_scheduled_work() call
pcmcia/yenta: guide users in case of problems with O2-bridges
pcmcia: fix unused function compile warning
pcmcia: vrc4173_cardu: Fix error path for pci_release_regions and pci_disable_device
pcmcia: add a few debug statements
pcmcia: remove obsolete and wrong comments
pcmcia: avoid messages on module (un)loading
pcmcia: move driver name to struct pcmcia_driver
pcmcia: remove the "Finally, report what we've done" message
pcmcia: use autoconfiguration feature for ioports and iomem
pcmcia: introduce autoconfiguration feature
pcmcia: Documentation update
pcmcia: convert pcmcia_request_configuration to pcmcia_enable_device
pcmcia: move config_{base,index,regs} to struct pcmcia_device
pcmcia: simplify IntType
pcmcia: simplify Status, ExtStatus register access
pcmcia: remove Pin, Copy configuration register access
pcmcia: move Vpp setup to struct pcmcia_device
...
Diffstat (limited to 'drivers/net/pcmcia/ibmtr_cs.c')
-rw-r--r-- | drivers/net/pcmcia/ibmtr_cs.c | 89 |
1 files changed, 25 insertions, 64 deletions
diff --git a/drivers/net/pcmcia/ibmtr_cs.c b/drivers/net/pcmcia/ibmtr_cs.c index b0d06a3d962..bf7dff96d88 100644 --- a/drivers/net/pcmcia/ibmtr_cs.c +++ b/drivers/net/pcmcia/ibmtr_cs.c @@ -57,7 +57,6 @@ #include <linux/trdevice.h> #include <linux/ibmtr.h> -#include <pcmcia/cs.h> #include <pcmcia/cistpl.h> #include <pcmcia/ds.h> @@ -102,9 +101,8 @@ static void ibmtr_detach(struct pcmcia_device *p_dev); typedef struct ibmtr_dev_t { struct pcmcia_device *p_dev; - struct net_device *dev; - window_handle_t sram_win_handle; - struct tok_info *ti; + struct net_device *dev; + struct tok_info *ti; } ibmtr_dev_t; static void netdev_get_drvinfo(struct net_device *dev, @@ -123,14 +121,6 @@ static irqreturn_t ibmtr_interrupt(int irq, void *dev_id) { return tok_interrupt(irq, dev); }; -/*====================================================================== - - ibmtr_attach() creates an "instance" of the driver, allocating - local data structures for one device. The device is registered - with Card Services. - -======================================================================*/ - static int __devinit ibmtr_attach(struct pcmcia_device *link) { ibmtr_dev_t *info; @@ -153,9 +143,8 @@ static int __devinit ibmtr_attach(struct pcmcia_device *link) link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8; link->resource[0]->end = 4; - link->conf.Attributes = CONF_ENABLE_IRQ; - link->conf.IntType = INT_MEMORY_AND_IO; - link->conf.Present = PRESENT_OPTION; + link->config_flags |= CONF_ENABLE_IRQ; + link->config_regs = PRESENT_OPTION; info->dev = dev; @@ -164,15 +153,6 @@ static int __devinit ibmtr_attach(struct pcmcia_device *link) return ibmtr_config(link); } /* ibmtr_attach */ -/*====================================================================== - - This deletes a driver "instance". The device is de-registered - with Card Services. If it has been released, all local data - structures are freed. Otherwise, the structures will be freed - when the device is released. - -======================================================================*/ - static void ibmtr_detach(struct pcmcia_device *link) { struct ibmtr_dev_t *info = link->priv; @@ -197,26 +177,17 @@ static void ibmtr_detach(struct pcmcia_device *link) kfree(info); } /* ibmtr_detach */ -/*====================================================================== - - ibmtr_config() is scheduled to run after a CARD_INSERTION event - is received, to configure the PCMCIA socket, and to make the - token-ring device available to the system. - -======================================================================*/ - static int __devinit ibmtr_config(struct pcmcia_device *link) { ibmtr_dev_t *info = link->priv; struct net_device *dev = info->dev; struct tok_info *ti = netdev_priv(dev); - win_req_t req; int i, ret; dev_dbg(&link->dev, "ibmtr_config\n"); - link->conf.ConfigIndex = 0x61; link->io_lines = 16; + link->config_index = 0x61; /* Determine if this is PRIMARY or ALTERNATE. */ @@ -240,39 +211,39 @@ static int __devinit ibmtr_config(struct pcmcia_device *link) ti->global_int_enable=GLOBAL_INT_ENABLE+((dev->irq==9) ? 2 : dev->irq); /* Allocate the MMIO memory window */ - req.Attributes = WIN_DATA_WIDTH_16|WIN_MEMORY_TYPE_CM|WIN_ENABLE; - req.Attributes |= WIN_USE_WAIT; - req.Base = 0; - req.Size = 0x2000; - req.AccessSpeed = 250; - ret = pcmcia_request_window(link, &req, &link->win); + link->resource[2]->flags |= WIN_DATA_WIDTH_16|WIN_MEMORY_TYPE_CM|WIN_ENABLE; + link->resource[2]->flags |= WIN_USE_WAIT; + link->resource[2]->start = 0; + link->resource[2]->end = 0x2000; + ret = pcmcia_request_window(link, link->resource[2], 250); if (ret) goto failed; - ret = pcmcia_map_mem_page(link, link->win, mmiobase); + ret = pcmcia_map_mem_page(link, link->resource[2], mmiobase); if (ret) goto failed; - ti->mmio = ioremap(req.Base, req.Size); + ti->mmio = ioremap(link->resource[2]->start, + resource_size(link->resource[2])); /* Allocate the SRAM memory window */ - req.Attributes = WIN_DATA_WIDTH_16|WIN_MEMORY_TYPE_CM|WIN_ENABLE; - req.Attributes |= WIN_USE_WAIT; - req.Base = 0; - req.Size = sramsize * 1024; - req.AccessSpeed = 250; - ret = pcmcia_request_window(link, &req, &info->sram_win_handle); + link->resource[3]->flags = WIN_DATA_WIDTH_16|WIN_MEMORY_TYPE_CM|WIN_ENABLE; + link->resource[3]->flags |= WIN_USE_WAIT; + link->resource[3]->start = 0; + link->resource[3]->end = sramsize * 1024; + ret = pcmcia_request_window(link, link->resource[3], 250); if (ret) goto failed; - ret = pcmcia_map_mem_page(link, info->sram_win_handle, srambase); + ret = pcmcia_map_mem_page(link, link->resource[3], srambase); if (ret) goto failed; ti->sram_base = srambase >> 12; - ti->sram_virt = ioremap(req.Base, req.Size); - ti->sram_phys = req.Base; + ti->sram_virt = ioremap(link->resource[3]->start, + resource_size(link->resource[3])); + ti->sram_phys = link->resource[3]->start; - ret = pcmcia_request_configuration(link, &link->conf); + ret = pcmcia_enable_device(link); if (ret) goto failed; @@ -301,14 +272,6 @@ failed: return -ENODEV; } /* ibmtr_config */ -/*====================================================================== - - After a card is removed, ibmtr_release() will unregister the net - device, and release the PCMCIA configuration. If the device is - still open, this will be postponed until it is closed. - -======================================================================*/ - static void ibmtr_release(struct pcmcia_device *link) { ibmtr_dev_t *info = link->priv; @@ -316,7 +279,7 @@ static void ibmtr_release(struct pcmcia_device *link) dev_dbg(&link->dev, "ibmtr_release\n"); - if (link->win) { + if (link->resource[2]->end) { struct tok_info *ti = netdev_priv(dev); iounmap(ti->mmio); } @@ -398,9 +361,7 @@ MODULE_DEVICE_TABLE(pcmcia, ibmtr_ids); static struct pcmcia_driver ibmtr_cs_driver = { .owner = THIS_MODULE, - .drv = { - .name = "ibmtr_cs", - }, + .name = "ibmtr_cs", .probe = ibmtr_attach, .remove = ibmtr_detach, .id_table = ibmtr_ids, |