aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/pcmcia
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2009-11-08 11:24:46 -0500
committerDominik Brodowski <linux@dominikbrodowski.net>2009-11-28 12:03:14 -0500
commit5fa9167a1bf5f5a4b7282f5e7ac56a4a5a1fa044 (patch)
tree2bf23e13308ef683302ff5a92af0ae8bc37c1b60 /drivers/net/pcmcia
parentdd2e5a156525f11754d9b1e0583f6bb49c253d62 (diff)
pcmcia: rework the irq_req_t typedef
Most of the irq_req_t typedef'd struct can be re-worked quite easily: (1) IRQInfo2 was unused in any case, so drop it. (2) IRQInfo1 was used write-only, so drop it. (3) Instance (private data to be passed to the IRQ handler): Most PCMCIA drivers using pcmcia_request_irq() to actually register an IRQ handler set the "dev_id" to the same pointer as the "priv" pointer in struct pcmcia_device. Modify the two exceptions (ipwireless, ibmtr_cs) to also work this waym and set the IRQ handler's "dev_id" to p_dev->priv unconditionally. (4) Handler is to be of type irq_handler_t. (5) Handler != NULL already tells whether an IRQ handler is present. Therefore, we do not need the IRQ_HANDLER_PRESENT flag in irq_req_t.Attributes. CC: netdev@vger.kernel.org CC: linux-bluetooth@vger.kernel.org CC: linux-ide@vger.kernel.org CC: linux-wireless@vger.kernel.org CC: linux-scsi@vger.kernel.org CC: alsa-devel@alsa-project.org CC: Jaroslav Kysela <perex@perex.cz> CC: Jiri Kosina <jkosina@suse.cz> CC: Karsten Keil <isdn@linux-pingi.de> for the Bluetooth parts: Acked-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'drivers/net/pcmcia')
-rw-r--r--drivers/net/pcmcia/3c574_cs.c4
-rw-r--r--drivers/net/pcmcia/3c589_cs.c4
-rw-r--r--drivers/net/pcmcia/axnet_cs.c1
-rw-r--r--drivers/net/pcmcia/com20020_cs.c8
-rw-r--r--drivers/net/pcmcia/fmvj18x_cs.c6
-rw-r--r--drivers/net/pcmcia/ibmtr_cs.c13
-rw-r--r--drivers/net/pcmcia/nmclan_cs.c4
-rw-r--r--drivers/net/pcmcia/pcnet_cs.c1
-rw-r--r--drivers/net/pcmcia/smc91c92_cs.c8
-rw-r--r--drivers/net/pcmcia/xirc2ps_cs.c3
10 files changed, 20 insertions, 32 deletions
diff --git a/drivers/net/pcmcia/3c574_cs.c b/drivers/net/pcmcia/3c574_cs.c
index 8b65e18ab230..17a27225cc98 100644
--- a/drivers/net/pcmcia/3c574_cs.c
+++ b/drivers/net/pcmcia/3c574_cs.c
@@ -283,10 +283,8 @@ static int tc574_probe(struct pcmcia_device *link)
283 spin_lock_init(&lp->window_lock); 283 spin_lock_init(&lp->window_lock);
284 link->io.NumPorts1 = 32; 284 link->io.NumPorts1 = 32;
285 link->io.Attributes1 = IO_DATA_PATH_WIDTH_16; 285 link->io.Attributes1 = IO_DATA_PATH_WIDTH_16;
286 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING|IRQ_HANDLE_PRESENT; 286 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
287 link->irq.IRQInfo1 = IRQ_LEVEL_ID;
288 link->irq.Handler = &el3_interrupt; 287 link->irq.Handler = &el3_interrupt;
289 link->irq.Instance = dev;
290 link->conf.Attributes = CONF_ENABLE_IRQ; 288 link->conf.Attributes = CONF_ENABLE_IRQ;
291 link->conf.IntType = INT_MEMORY_AND_IO; 289 link->conf.IntType = INT_MEMORY_AND_IO;
292 link->conf.ConfigIndex = 1; 290 link->conf.ConfigIndex = 1;
diff --git a/drivers/net/pcmcia/3c589_cs.c b/drivers/net/pcmcia/3c589_cs.c
index c43c21ddb2d1..6f8d7e2e5922 100644
--- a/drivers/net/pcmcia/3c589_cs.c
+++ b/drivers/net/pcmcia/3c589_cs.c
@@ -194,10 +194,8 @@ static int tc589_probe(struct pcmcia_device *link)
194 spin_lock_init(&lp->lock); 194 spin_lock_init(&lp->lock);
195 link->io.NumPorts1 = 16; 195 link->io.NumPorts1 = 16;
196 link->io.Attributes1 = IO_DATA_PATH_WIDTH_16; 196 link->io.Attributes1 = IO_DATA_PATH_WIDTH_16;
197 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING|IRQ_HANDLE_PRESENT; 197 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
198 link->irq.IRQInfo1 = IRQ_LEVEL_ID;
199 link->irq.Handler = &el3_interrupt; 198 link->irq.Handler = &el3_interrupt;
200 link->irq.Instance = dev;
201 link->conf.Attributes = CONF_ENABLE_IRQ; 199 link->conf.Attributes = CONF_ENABLE_IRQ;
202 link->conf.IntType = INT_MEMORY_AND_IO; 200 link->conf.IntType = INT_MEMORY_AND_IO;
203 link->conf.ConfigIndex = 1; 201 link->conf.ConfigIndex = 1;
diff --git a/drivers/net/pcmcia/axnet_cs.c b/drivers/net/pcmcia/axnet_cs.c
index 0552dddd587f..800597b82d18 100644
--- a/drivers/net/pcmcia/axnet_cs.c
+++ b/drivers/net/pcmcia/axnet_cs.c
@@ -170,7 +170,6 @@ static int axnet_probe(struct pcmcia_device *link)
170 info->p_dev = link; 170 info->p_dev = link;
171 link->priv = dev; 171 link->priv = dev;
172 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING; 172 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
173 link->irq.IRQInfo1 = IRQ_LEVEL_ID;
174 link->conf.Attributes = CONF_ENABLE_IRQ; 173 link->conf.Attributes = CONF_ENABLE_IRQ;
175 link->conf.IntType = INT_MEMORY_AND_IO; 174 link->conf.IntType = INT_MEMORY_AND_IO;
176 175
diff --git a/drivers/net/pcmcia/com20020_cs.c b/drivers/net/pcmcia/com20020_cs.c
index 51e9cb0a6d1e..21d9c9d815d1 100644
--- a/drivers/net/pcmcia/com20020_cs.c
+++ b/drivers/net/pcmcia/com20020_cs.c
@@ -164,11 +164,10 @@ static int com20020_probe(struct pcmcia_device *p_dev)
164 p_dev->io.NumPorts1 = 16; 164 p_dev->io.NumPorts1 = 16;
165 p_dev->io.IOAddrLines = 16; 165 p_dev->io.IOAddrLines = 16;
166 p_dev->irq.Attributes = IRQ_TYPE_EXCLUSIVE; 166 p_dev->irq.Attributes = IRQ_TYPE_EXCLUSIVE;
167 p_dev->irq.IRQInfo1 = IRQ_LEVEL_ID;
168 p_dev->conf.Attributes = CONF_ENABLE_IRQ; 167 p_dev->conf.Attributes = CONF_ENABLE_IRQ;
169 p_dev->conf.IntType = INT_MEMORY_AND_IO; 168 p_dev->conf.IntType = INT_MEMORY_AND_IO;
170 169
171 p_dev->irq.Instance = info->dev = dev; 170 info->dev = dev;
172 p_dev->priv = info; 171 p_dev->priv = info;
173 172
174 return com20020_config(p_dev); 173 return com20020_config(p_dev);
@@ -275,9 +274,8 @@ static int com20020_config(struct pcmcia_device *link)
275 ioaddr = dev->base_addr = link->io.BasePort1; 274 ioaddr = dev->base_addr = link->io.BasePort1;
276 dev_dbg(&link->dev, "got ioaddr %Xh\n", ioaddr); 275 dev_dbg(&link->dev, "got ioaddr %Xh\n", ioaddr);
277 276
278 dev_dbg(&link->dev, "request IRQ %d (%Xh/%Xh)\n", 277 dev_dbg(&link->dev, "request IRQ %d\n",
279 link->irq.AssignedIRQ, 278 link->irq.AssignedIRQ);
280 link->irq.IRQInfo1, link->irq.IRQInfo2);
281 i = pcmcia_request_irq(link, &link->irq); 279 i = pcmcia_request_irq(link, &link->irq);
282 if (i != 0) 280 if (i != 0)
283 { 281 {
diff --git a/drivers/net/pcmcia/fmvj18x_cs.c b/drivers/net/pcmcia/fmvj18x_cs.c
index 9b5ca37c6684..6e3e1ced6db4 100644
--- a/drivers/net/pcmcia/fmvj18x_cs.c
+++ b/drivers/net/pcmcia/fmvj18x_cs.c
@@ -255,10 +255,8 @@ static int fmvj18x_probe(struct pcmcia_device *link)
255 link->io.IOAddrLines = 5; 255 link->io.IOAddrLines = 5;
256 256
257 /* Interrupt setup */ 257 /* Interrupt setup */
258 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING|IRQ_HANDLE_PRESENT; 258 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
259 link->irq.IRQInfo1 = IRQ_LEVEL_ID;
260 link->irq.Handler = &fjn_interrupt; 259 link->irq.Handler = &fjn_interrupt;
261 link->irq.Instance = dev;
262 260
263 /* General socket configuration */ 261 /* General socket configuration */
264 link->conf.Attributes = CONF_ENABLE_IRQ; 262 link->conf.Attributes = CONF_ENABLE_IRQ;
@@ -428,7 +426,7 @@ static int fmvj18x_config(struct pcmcia_device *link)
428 426
429 if (link->io.NumPorts2 != 0) { 427 if (link->io.NumPorts2 != 0) {
430 link->irq.Attributes = 428 link->irq.Attributes =
431 IRQ_TYPE_DYNAMIC_SHARING|IRQ_FIRST_SHARED|IRQ_HANDLE_PRESENT; 429 IRQ_TYPE_DYNAMIC_SHARING|IRQ_FIRST_SHARED;
432 ret = mfc_try_io_port(link); 430 ret = mfc_try_io_port(link);
433 if (ret != 0) goto failed; 431 if (ret != 0) goto failed;
434 } else if (cardtype == UNGERMANN) { 432 } else if (cardtype == UNGERMANN) {
diff --git a/drivers/net/pcmcia/ibmtr_cs.c b/drivers/net/pcmcia/ibmtr_cs.c
index 76706e12d731..37f4a6fdc3ef 100644
--- a/drivers/net/pcmcia/ibmtr_cs.c
+++ b/drivers/net/pcmcia/ibmtr_cs.c
@@ -119,6 +119,12 @@ static const struct ethtool_ops netdev_ethtool_ops = {
119 .get_drvinfo = netdev_get_drvinfo, 119 .get_drvinfo = netdev_get_drvinfo,
120}; 120};
121 121
122static irqreturn_t ibmtr_interrupt(int irq, void *dev_id) {
123 ibmtr_dev_t *info = dev_id;
124 struct net_device *dev = info->dev;
125 return tok_interrupt(irq, dev);
126};
127
122/*====================================================================== 128/*======================================================================
123 129
124 ibmtr_attach() creates an "instance" of the driver, allocating 130 ibmtr_attach() creates an "instance" of the driver, allocating
@@ -150,14 +156,13 @@ static int __devinit ibmtr_attach(struct pcmcia_device *link)
150 link->io.Attributes1 = IO_DATA_PATH_WIDTH_8; 156 link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
151 link->io.NumPorts1 = 4; 157 link->io.NumPorts1 = 4;
152 link->io.IOAddrLines = 16; 158 link->io.IOAddrLines = 16;
153 link->irq.Attributes = IRQ_TYPE_EXCLUSIVE | IRQ_HANDLE_PRESENT; 159 link->irq.Attributes = IRQ_TYPE_EXCLUSIVE;
154 link->irq.IRQInfo1 = IRQ_LEVEL_ID; 160 link->irq.Handler = ibmtr_interrupt;
155 link->irq.Handler = &tok_interrupt;
156 link->conf.Attributes = CONF_ENABLE_IRQ; 161 link->conf.Attributes = CONF_ENABLE_IRQ;
157 link->conf.IntType = INT_MEMORY_AND_IO; 162 link->conf.IntType = INT_MEMORY_AND_IO;
158 link->conf.Present = PRESENT_OPTION; 163 link->conf.Present = PRESENT_OPTION;
159 164
160 link->irq.Instance = info->dev = dev; 165 info->dev = dev;
161 166
162 SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops); 167 SET_ETHTOOL_OPS(dev, &netdev_ethtool_ops);
163 168
diff --git a/drivers/net/pcmcia/nmclan_cs.c b/drivers/net/pcmcia/nmclan_cs.c
index 2d0c6f93ed8b..dae5ef6b2609 100644
--- a/drivers/net/pcmcia/nmclan_cs.c
+++ b/drivers/net/pcmcia/nmclan_cs.c
@@ -463,10 +463,8 @@ static int nmclan_probe(struct pcmcia_device *link)
463 link->io.NumPorts1 = 32; 463 link->io.NumPorts1 = 32;
464 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 464 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
465 link->io.IOAddrLines = 5; 465 link->io.IOAddrLines = 5;
466 link->irq.Attributes = IRQ_TYPE_EXCLUSIVE | IRQ_HANDLE_PRESENT; 466 link->irq.Attributes = IRQ_TYPE_EXCLUSIVE;
467 link->irq.IRQInfo1 = IRQ_LEVEL_ID;
468 link->irq.Handler = &mace_interrupt; 467 link->irq.Handler = &mace_interrupt;
469 link->irq.Instance = dev;
470 link->conf.Attributes = CONF_ENABLE_IRQ; 468 link->conf.Attributes = CONF_ENABLE_IRQ;
471 link->conf.IntType = INT_MEMORY_AND_IO; 469 link->conf.IntType = INT_MEMORY_AND_IO;
472 link->conf.ConfigIndex = 1; 470 link->conf.ConfigIndex = 1;
diff --git a/drivers/net/pcmcia/pcnet_cs.c b/drivers/net/pcmcia/pcnet_cs.c
index 30baee7b86a2..de2d10085635 100644
--- a/drivers/net/pcmcia/pcnet_cs.c
+++ b/drivers/net/pcmcia/pcnet_cs.c
@@ -266,7 +266,6 @@ static int pcnet_probe(struct pcmcia_device *link)
266 link->priv = dev; 266 link->priv = dev;
267 267
268 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING; 268 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
269 link->irq.IRQInfo1 = IRQ_LEVEL_ID;
270 link->conf.Attributes = CONF_ENABLE_IRQ; 269 link->conf.Attributes = CONF_ENABLE_IRQ;
271 link->conf.IntType = INT_MEMORY_AND_IO; 270 link->conf.IntType = INT_MEMORY_AND_IO;
272 271
diff --git a/drivers/net/pcmcia/smc91c92_cs.c b/drivers/net/pcmcia/smc91c92_cs.c
index 2e795de06cb3..9e0da370912e 100644
--- a/drivers/net/pcmcia/smc91c92_cs.c
+++ b/drivers/net/pcmcia/smc91c92_cs.c
@@ -329,10 +329,8 @@ static int smc91c92_probe(struct pcmcia_device *link)
329 link->io.NumPorts1 = 16; 329 link->io.NumPorts1 = 16;
330 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; 330 link->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
331 link->io.IOAddrLines = 4; 331 link->io.IOAddrLines = 4;
332 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING|IRQ_HANDLE_PRESENT; 332 link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
333 link->irq.IRQInfo1 = IRQ_LEVEL_ID;
334 link->irq.Handler = &smc_interrupt; 333 link->irq.Handler = &smc_interrupt;
335 link->irq.Instance = dev;
336 link->conf.Attributes = CONF_ENABLE_IRQ; 334 link->conf.Attributes = CONF_ENABLE_IRQ;
337 link->conf.IntType = INT_MEMORY_AND_IO; 335 link->conf.IntType = INT_MEMORY_AND_IO;
338 336
@@ -456,7 +454,7 @@ static int mhz_mfc_config(struct pcmcia_device *link)
456 link->conf.Attributes |= CONF_ENABLE_SPKR; 454 link->conf.Attributes |= CONF_ENABLE_SPKR;
457 link->conf.Status = CCSR_AUDIO_ENA; 455 link->conf.Status = CCSR_AUDIO_ENA;
458 link->irq.Attributes = 456 link->irq.Attributes =
459 IRQ_TYPE_DYNAMIC_SHARING|IRQ_FIRST_SHARED|IRQ_HANDLE_PRESENT; 457 IRQ_TYPE_DYNAMIC_SHARING|IRQ_FIRST_SHARED;
460 link->io.IOAddrLines = 16; 458 link->io.IOAddrLines = 16;
461 link->io.Attributes2 = IO_DATA_PATH_WIDTH_8; 459 link->io.Attributes2 = IO_DATA_PATH_WIDTH_8;
462 link->io.NumPorts2 = 8; 460 link->io.NumPorts2 = 8;
@@ -655,7 +653,7 @@ static int osi_config(struct pcmcia_device *link)
655 link->conf.Attributes |= CONF_ENABLE_SPKR; 653 link->conf.Attributes |= CONF_ENABLE_SPKR;
656 link->conf.Status = CCSR_AUDIO_ENA; 654 link->conf.Status = CCSR_AUDIO_ENA;
657 link->irq.Attributes = 655 link->irq.Attributes =
658 IRQ_TYPE_DYNAMIC_SHARING|IRQ_FIRST_SHARED|IRQ_HANDLE_PRESENT; 656 IRQ_TYPE_DYNAMIC_SHARING|IRQ_FIRST_SHARED;
659 link->io.NumPorts1 = 64; 657 link->io.NumPorts1 = 64;
660 link->io.Attributes2 = IO_DATA_PATH_WIDTH_8; 658 link->io.Attributes2 = IO_DATA_PATH_WIDTH_8;
661 link->io.NumPorts2 = 8; 659 link->io.NumPorts2 = 8;
diff --git a/drivers/net/pcmcia/xirc2ps_cs.c b/drivers/net/pcmcia/xirc2ps_cs.c
index f75ac716390d..fe504b7f369f 100644
--- a/drivers/net/pcmcia/xirc2ps_cs.c
+++ b/drivers/net/pcmcia/xirc2ps_cs.c
@@ -556,7 +556,6 @@ xirc2ps_probe(struct pcmcia_device *link)
556 link->conf.IntType = INT_MEMORY_AND_IO; 556 link->conf.IntType = INT_MEMORY_AND_IO;
557 link->conf.ConfigIndex = 1; 557 link->conf.ConfigIndex = 1;
558 link->irq.Handler = xirc2ps_interrupt; 558 link->irq.Handler = xirc2ps_interrupt;
559 link->irq.Instance = dev;
560 559
561 /* Fill in card specific entries */ 560 /* Fill in card specific entries */
562 dev->netdev_ops = &netdev_ops; 561 dev->netdev_ops = &netdev_ops;
@@ -835,8 +834,6 @@ xirc2ps_config(struct pcmcia_device * link)
835 834
836 link->io.IOAddrLines =10; 835 link->io.IOAddrLines =10;
837 link->io.Attributes1 = IO_DATA_PATH_WIDTH_16; 836 link->io.Attributes1 = IO_DATA_PATH_WIDTH_16;
838 link->irq.Attributes = IRQ_HANDLE_PRESENT;
839 link->irq.IRQInfo1 = IRQ_LEVEL_ID;
840 if (local->modem) { 837 if (local->modem) {
841 int pass; 838 int pass;
842 839