linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] build fixes for compat-wireless due to PCMCIA changes
@ 2010-08-04 14:18 Kshitij Kulshreshtha
  2010-08-04 14:18 ` [PATCH] compat: backport pcmcia_{read,write}_config byte from v2.6.36 Kshitij Kulshreshtha
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Kshitij Kulshreshtha @ 2010-08-04 14:18 UTC (permalink / raw)
  To: Luis R. Rodriguez, Hauke Mehrtens; +Cc: linux-wireless

Hello,
here are two patches for compat and compat-wireless that fix build with
linux-next.git tag next-20100804 and kernel v2.6.34

The patch for compat-wireless is only 
leftovers from Luis R. Rodriguez' commit dedb6981 in 
drivers/net/wireless/orinoco/{orinoco,spectrum}_cs.c

The patch for compat backports the newly added pcmcia_{read,write}_config_byte()
functions in <pcmcia/ds.h>

Thanks and regards.
--
Kshitij Kulshreshtha

Institut für Mathematik,
Universität Paderborn,
Warburger Straße 100,
33098 Paderborn.

Büro: A3.319

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] compat: backport pcmcia_{read,write}_config byte from v2.6.36
  2010-08-04 14:18 [PATCH] build fixes for compat-wireless due to PCMCIA changes Kshitij Kulshreshtha
@ 2010-08-04 14:18 ` Kshitij Kulshreshtha
  2010-08-04 14:18 ` [PATCH] compat-wireless: more PCMCIA backporting Kshitij Kulshreshtha
  2010-08-05 18:27 ` [PATCH] build fixes for compat-wireless due to PCMCIA changes Luis R. Rodriguez
  2 siblings, 0 replies; 4+ messages in thread
From: Kshitij Kulshreshtha @ 2010-08-04 14:18 UTC (permalink / raw)
  To: Luis R. Rodriguez, Hauke Mehrtens; +Cc: linux-wireless, Kshitij Kulshreshtha

Signed-off-by: Kshitij Kulshreshtha <kkhere.geo@gmail.com>
---
 include/pcmcia/ds.h |   36 ++++++++++++++++++++++++++++++++++++
 1 files changed, 36 insertions(+), 0 deletions(-)
 create mode 100644 include/pcmcia/ds.h

diff --git a/include/pcmcia/ds.h b/include/pcmcia/ds.h
new file mode 100644
index 0000000..fc43703
--- /dev/null
+++ b/include/pcmcia/ds.h
@@ -0,0 +1,36 @@
+#ifndef _COMPAT_PCMCIA_DS_H
+#define _COMPAT_PCMCIA_DS_H
+#include <linux/version.h>
+
+#include_next <pcmcia/ds.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36)
+/**
+ * pcmcia_read_config_byte() - read a byte from a card configuration register
+ *
+ * pcmcia_read_config_byte() reads a byte from a configuration register in
+ * attribute memory.
+ */
+static inline int pcmcia_read_config_byte(struct pcmcia_device *p_dev, off_t where, u8 *val)
+{
+        int ret;
+        conf_reg_t reg = { 0, CS_READ, where, 0 };
+        ret = pcmcia_access_configuration_register(p_dev, &reg);
+        *val = reg.Value;
+        return ret;
+}
+
+/**
+ * pcmcia_write_config_byte() - write a byte to a card configuration register
+ *
+ * pcmcia_write_config_byte() writes a byte to a configuration register in
+ * attribute memory.
+ */
+static inline int pcmcia_write_config_byte(struct pcmcia_device *p_dev, off_t where, u8 val)
+{
+	conf_reg_t reg = { 0, CS_WRITE, where, val };
+	return pcmcia_access_configuration_register(p_dev, &reg);
+}
+#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(2,6,36) */
+
+#endif
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH] compat-wireless: more PCMCIA backporting
  2010-08-04 14:18 [PATCH] build fixes for compat-wireless due to PCMCIA changes Kshitij Kulshreshtha
  2010-08-04 14:18 ` [PATCH] compat: backport pcmcia_{read,write}_config byte from v2.6.36 Kshitij Kulshreshtha
@ 2010-08-04 14:18 ` Kshitij Kulshreshtha
  2010-08-05 18:27 ` [PATCH] build fixes for compat-wireless due to PCMCIA changes Luis R. Rodriguez
  2 siblings, 0 replies; 4+ messages in thread
From: Kshitij Kulshreshtha @ 2010-08-04 14:18 UTC (permalink / raw)
  To: Luis R. Rodriguez, Hauke Mehrtens; +Cc: linux-wireless, Kshitij Kulshreshtha

to fix build, these changes are leftovers from commit

    commit dedb69815e9608360249e62a794e3dea6a867ab8
    Author: Luis R. Rodriguez <lrodriguez@atheros.com>
    Date:   Tue Aug 3 13:30:01 2010 -0700

        compat-wireless: backport and fix new PCMCIA changes


Signed-off-by: Kshitij Kulshreshtha <kkhere.geo@gmail.com>
---
 patches/24-pcmcia.patch |  131 +++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 126 insertions(+), 5 deletions(-)

diff --git a/patches/24-pcmcia.patch b/patches/24-pcmcia.patch
index 9fb0e77..b1d65bf 100644
--- a/patches/24-pcmcia.patch
+++ b/patches/24-pcmcia.patch
@@ -275,7 +275,56 @@
  	/* General socket configuration defaults can go here.  In this
  	 * client, we assume very little, and rely on the CIS for
  	 * almost everything.  In most clients, many details (i.e.,
-@@ -248,7 +258,11 @@ orinoco_cs_config(struct pcmcia_device *
+@@ -191,23 +201,48 @@ static int orinoco_cs_config_check(struc
+ 	p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
+ 
+ 	/* IO window settings */
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)
+ 	p_dev->resource[0]->end = p_dev->resource[1]->end = 0;
++#else
++	p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0;
++#endif
+ 	if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) {
+ 		cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io;
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)
+ 		p_dev->io_lines = io->flags & CISTPL_IO_LINES_MASK;
+ 		p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH;
+ 		p_dev->resource[0]->flags |=
+ 			pcmcia_io_cfg_data_width(io->flags);
+ 		p_dev->resource[0]->start = io->win[0].base;
+ 		p_dev->resource[0]->end = io->win[0].len;
++#else
++		p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
++		if (!(io->flags & CISTPL_IO_8BIT))
++			p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_16;
++		if (!(io->flags & CISTPL_IO_16BIT))
++			p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
++		p_dev->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK;
++		p_dev->io.BasePort1 = io->win[0].base;
++		p_dev->io.NumPorts1 = io->win[0].len;
++#endif
+ 		if (io->nwin > 1) {
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)
+ 			p_dev->resource[1]->flags = p_dev->resource[0]->flags;
+ 			p_dev->resource[1]->start = io->win[1].base;
+ 			p_dev->resource[1]->end = io->win[1].len;
++#else
++			p_dev->io.Attributes2 = p_dev->io.Attributes1;
++			p_dev->io.BasePort2 = io->win[1].base;
++			p_dev->io.NumPorts2 = io->win[1].len;
++#endif
+ 		}
+ 
+ 		/* This reserves IO space but doesn't actually enable it */
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)
+ 		if (pcmcia_request_io(p_dev) != 0)
++#else
++		if (pcmcia_request_io(p_dev, &p_dev->io) != 0)
++#endif
+ 			goto next_entry;
+ 	}
+ 	return 0;
+@@ -248,15 +283,23 @@ orinoco_cs_config(struct pcmcia_device *
  		goto failed;
  	}
  
@@ -287,7 +336,19 @@
  	if (ret)
  		goto failed;
  
-@@ -278,8 +292,16 @@ orinoco_cs_config(struct pcmcia_device *
+ 	/* We initialize the hermes structure before completing PCMCIA
+ 	 * configuration just in case the interrupt handler gets
+ 	 * called. */
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)
+ 	mem = ioport_map(link->resource[0]->start,
+ 			resource_size(link->resource[0]));
++#else
++	mem = ioport_map(link->io.BasePort1, link->io.NumPorts1);
++#endif
+ 	if (!mem)
+ 		goto failed;
+ 
+@@ -278,8 +321,16 @@ orinoco_cs_config(struct pcmcia_device *
  	}
  
  	/* Register an interface with the stack */
@@ -319,7 +380,56 @@
  	/* General socket configuration defaults can go here.  In this
  	 * client, we assume very little, and rely on the CIS for
  	 * almost everything.  In most clients, many details (i.e.,
-@@ -310,7 +316,11 @@ spectrum_cs_config(struct pcmcia_device 
+@@ -253,23 +259,48 @@ static int spectrum_cs_config_check(stru
+ 	p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
+ 
+ 	/* IO window settings */
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)
+ 	p_dev->resource[0]->end = p_dev->resource[1]->end = 0;
++#else
++	p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0;
++#endif
+ 	if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) {
+ 		cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io;
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)
+ 		p_dev->io_lines = io->flags & CISTPL_IO_LINES_MASK;
+ 		p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH;
+ 		p_dev->resource[0]->flags |=
+ 			pcmcia_io_cfg_data_width(io->flags);
+ 		p_dev->resource[0]->start = io->win[0].base;
+ 		p_dev->resource[0]->end = io->win[0].len;
++#else
++		p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
++		if (!(io->flags & CISTPL_IO_8BIT))
++			p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_16;
++		if (!(io->flags & CISTPL_IO_16BIT))
++			p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
++		p_dev->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK;
++		p_dev->io.BasePort1 = io->win[0].base;
++		p_dev->io.NumPorts1 = io->win[0].len;
++#endif
+ 		if (io->nwin > 1) {
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)
+ 			p_dev->resource[1]->flags = p_dev->resource[0]->flags;
+ 			p_dev->resource[1]->start = io->win[1].base;
+ 			p_dev->resource[1]->end = io->win[1].len;
++#else
++			p_dev->io.Attributes2 = p_dev->io.Attributes1;
++			p_dev->io.BasePort2 = io->win[1].base;
++			p_dev->io.NumPorts2 = io->win[1].len;
++#endif
+ 		}
+ 
+ 		/* This reserves IO space but doesn't actually enable it */
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)
+ 		if (pcmcia_request_io(p_dev) != 0)
++#else
++		if (pcmcia_request_io(p_dev, &p_dev->io) != 0)
++#endif
+ 			goto next_entry;
+ 	}
+ 	return 0;
+@@ -310,15 +341,23 @@ spectrum_cs_config(struct pcmcia_device
  		goto failed;
  	}
  
@@ -331,7 +441,19 @@
  	if (ret)
  		goto failed;
  
-@@ -345,8 +355,17 @@ spectrum_cs_config(struct pcmcia_device 
+ 	/* We initialize the hermes structure before completing PCMCIA
+ 	 * configuration just in case the interrupt handler gets
+ 	 * called. */
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)
+ 	mem = ioport_map(link->resource[0]->start,
+ 			resource_size(link->resource[0]));
++#else
++	mem = ioport_map(link->io.BasePort1, link->io.NumPorts1);
++#endif
+ 	if (!mem)
+ 		goto failed;
+ 
+@@ -345,8 +384,16 @@ spectrum_cs_config(struct pcmcia_device
  	}
  
  	/* Register an interface with the stack */
@@ -343,7 +465,6 @@
 +			   link->irq, NULL) != 0) {
 +#else
 +	if (orinoco_if_add(priv, link->io.BasePort1,
-+			   link->irq, NULL) != 0) {
 +			   link->irq.AssignedIRQ, NULL) != 0) {
 +#endif
  		printk(KERN_ERR PFX "orinoco_if_add() failed\n");
-- 
1.7.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] build fixes for compat-wireless due to PCMCIA changes
  2010-08-04 14:18 [PATCH] build fixes for compat-wireless due to PCMCIA changes Kshitij Kulshreshtha
  2010-08-04 14:18 ` [PATCH] compat: backport pcmcia_{read,write}_config byte from v2.6.36 Kshitij Kulshreshtha
  2010-08-04 14:18 ` [PATCH] compat-wireless: more PCMCIA backporting Kshitij Kulshreshtha
@ 2010-08-05 18:27 ` Luis R. Rodriguez
  2 siblings, 0 replies; 4+ messages in thread
From: Luis R. Rodriguez @ 2010-08-05 18:27 UTC (permalink / raw)
  To: Kshitij Kulshreshtha; +Cc: Hauke Mehrtens, linux-wireless

On Wed, Aug 4, 2010 at 7:18 AM, Kshitij Kulshreshtha
<kkhere.geo@gmail.com> wrote:
> Hello,
> here are two patches for compat and compat-wireless that fix build with
> linux-next.git tag next-20100804 and kernel v2.6.34
>
> The patch for compat-wireless is only
> leftovers from Luis R. Rodriguez' commit dedb6981 in
> drivers/net/wireless/orinoco/{orinoco,spectrum}_cs.c
>
> The patch for compat backports the newly added pcmcia_{read,write}_config_byte()
> functions in <pcmcia/ds.h>
>
> Thanks and regards.

Thank you, patches applied and pushed out!

  Luis

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-08-05 18:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-04 14:18 [PATCH] build fixes for compat-wireless due to PCMCIA changes Kshitij Kulshreshtha
2010-08-04 14:18 ` [PATCH] compat: backport pcmcia_{read,write}_config byte from v2.6.36 Kshitij Kulshreshtha
2010-08-04 14:18 ` [PATCH] compat-wireless: more PCMCIA backporting Kshitij Kulshreshtha
2010-08-05 18:27 ` [PATCH] build fixes for compat-wireless due to PCMCIA changes Luis R. Rodriguez

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).