* [PATCH 1/4] compat-wireless: make patches apply again
@ 2010-09-19 17:46 Hauke Mehrtens
2010-09-19 17:49 ` [PATCH 2/4] compat-wireless: "backport" pcmcia api changes Hauke Mehrtens
` (2 more replies)
0 siblings, 3 replies; 9+ messages in thread
From: Hauke Mehrtens @ 2010-09-19 17:46 UTC (permalink / raw)
To: lrodriguez; +Cc: linux-wireless, mcgrof, Hauke Mehrtens
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
patches/01-netdev.patch | 16 ++++++++--------
patches/30-bridge-port.patch | 10 +++++-----
2 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/patches/01-netdev.patch b/patches/01-netdev.patch
index a62571b..5e24cfb 100644
--- a/patches/01-netdev.patch
+++ b/patches/01-netdev.patch
@@ -45,7 +45,7 @@ without creating a headache on maintenance of the pathes.
retval = rndis_set_oid(usbdev, OID_GEN_CURRENT_PACKET_FILTER, &tmp,
--- a/net/mac80211/iface.c
+++ b/net/mac80211/iface.c
-@@ -698,7 +698,12 @@ static const struct net_device_ops ieee8
+@@ -701,7 +701,12 @@ static const struct net_device_ops ieee8
static void ieee80211_if_setup(struct net_device *dev)
{
ether_setup(dev);
@@ -59,16 +59,16 @@ without creating a headache on maintenance of the pathes.
dev->destructor = free_netdev;
}
-@@ -843,7 +848,7 @@ static void ieee80211_setup_sdata(struct
-
+@@ -847,7 +852,7 @@ static void ieee80211_setup_sdata(struct
/* and set some type-dependent values */
sdata->vif.type = type;
+ sdata->vif.p2p = false;
- sdata->dev->netdev_ops = &ieee80211_dataif_ops;
+ netdev_attach_ops(sdata->dev, &ieee80211_dataif_ops);
sdata->wdev.iftype = type;
sdata->control_port_protocol = cpu_to_be16(ETH_P_PAE);
-@@ -872,7 +877,7 @@ static void ieee80211_setup_sdata(struct
+@@ -886,7 +891,7 @@ static void ieee80211_setup_sdata(struct
break;
case NL80211_IFTYPE_MONITOR:
sdata->dev->type = ARPHRD_IEEE80211_RADIOTAP;
@@ -77,7 +77,7 @@ without creating a headache on maintenance of the pathes.
sdata->u.mntr_flags = MONITOR_FLAG_CONTROL |
MONITOR_FLAG_OTHER_BSS;
break;
-@@ -1113,6 +1118,8 @@ int ieee80211_if_add(struct ieee80211_lo
+@@ -1137,6 +1142,8 @@ int ieee80211_if_add(struct ieee80211_lo
return -ENOMEM;
dev_net_set(ndev, wiphy_net(local->hw.wiphy));
@@ -86,7 +86,7 @@ without creating a headache on maintenance of the pathes.
ndev->needed_headroom = local->tx_headroom +
4*6 /* four MAC addresses */
+ 2 + 2 + 2 + 2 /* ctl, dur, seq, qos */
-@@ -1121,6 +1128,7 @@ int ieee80211_if_add(struct ieee80211_lo
+@@ -1145,6 +1152,7 @@ int ieee80211_if_add(struct ieee80211_lo
- ETH_HLEN /* ethernet hard_header_len */
+ IEEE80211_ENCRYPT_HEADROOM;
ndev->needed_tailroom = IEEE80211_ENCRYPT_TAILROOM;
@@ -94,7 +94,7 @@ without creating a headache on maintenance of the pathes.
ret = dev_alloc_name(ndev, ndev->name);
if (ret < 0)
-@@ -1169,6 +1177,10 @@ int ieee80211_if_add(struct ieee80211_lo
+@@ -1193,6 +1201,10 @@ int ieee80211_if_add(struct ieee80211_lo
if (ret)
goto fail;
@@ -267,7 +267,7 @@ without creating a headache on maintenance of the pathes.
#define LBS_DEB_LEAVE 0x00000002
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
-@@ -1095,7 +1095,7 @@ static const struct net_device_ops hwsim
+@@ -1100,7 +1100,7 @@ static const struct net_device_ops hwsim
static void hwsim_mon_setup(struct net_device *dev)
{
diff --git a/patches/30-bridge-port.patch b/patches/30-bridge-port.patch
index c2f9b3a..c2ffc45 100644
--- a/patches/30-bridge-port.patch
+++ b/patches/30-bridge-port.patch
@@ -23,18 +23,18 @@ compat-wireless.
--- a/net/wireless/util.c
+++ b/net/wireless/util.c
-@@ -777,7 +777,7 @@ int cfg80211_change_iface(struct cfg8021
+@@ -781,7 +781,7 @@ int cfg80211_change_iface(struct cfg8021
return -EOPNOTSUPP;
/* if it's part of a bridge, reject changing type to station/ibss */
- if ((dev->priv_flags & IFF_BRIDGE_PORT) &&
+ if (br_port_exists(dev) &&
- (ntype == NL80211_IFTYPE_ADHOC || ntype == NL80211_IFTYPE_STATION))
- return -EBUSY;
-
+ (ntype == NL80211_IFTYPE_ADHOC ||
+ ntype == NL80211_IFTYPE_STATION ||
+ ntype == NL80211_IFTYPE_P2P_CLIENT))
--- a/net/wireless/nl80211.c
+++ b/net/wireless/nl80211.c
-@@ -1197,7 +1197,7 @@ static int nl80211_valid_4addr(struct cf
+@@ -1200,7 +1200,7 @@ static int nl80211_valid_4addr(struct cf
enum nl80211_iftype iftype)
{
if (!use_4addr) {
--
1.7.0.4
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 2/4] compat-wireless: "backport" pcmcia api changes.
2010-09-19 17:46 [PATCH 1/4] compat-wireless: make patches apply again Hauke Mehrtens
@ 2010-09-19 17:49 ` Hauke Mehrtens
2010-09-19 17:56 ` [PATCH 2/2 v2] " Hauke Mehrtens
2010-09-19 17:49 ` [PATCH 3/4] compat-wirelsss: add carl9170 Hauke Mehrtens
2010-09-19 17:49 ` [PATCH 4/4] compat-wireless: fix unresolved symbols with old kernels Hauke Mehrtens
2 siblings, 1 reply; 9+ messages in thread
From: Hauke Mehrtens @ 2010-09-19 17:49 UTC (permalink / raw)
To: lrodriguez; +Cc: linux-wireless, mcgrof, Hauke Mehrtens
The pcmcia API changed again.
This patch was only compile tested, beacuse I do not have devices to
test this.
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
patches/24-pcmcia.patch | 854 ++++++++++++++++++++++++++++++++++++-----------
1 files changed, 665 insertions(+), 189 deletions(-)
diff --git a/patches/24-pcmcia.patch b/patches/24-pcmcia.patch
index 6324a76..6cf1047 100644
--- a/patches/24-pcmcia.patch
+++ b/patches/24-pcmcia.patch
@@ -1,6 +1,8 @@
+diff --git a/drivers/bluetooth/bluecard_cs.c b/drivers/bluetooth/bluecard_cs.c
+index 4104b7f..c619341 100644
--- a/drivers/bluetooth/bluecard_cs.c
+++ b/drivers/bluetooth/bluecard_cs.c
-@@ -159,7 +159,12 @@ static void bluecard_detach(struct pcmci
+@@ -158,7 +158,12 @@ static void bluecard_detach(struct pcmcia_device *p_dev);
static void bluecard_activity_led_timeout(u_long arg)
{
bluecard_info_t *info = (bluecard_info_t *)arg;
@@ -13,7 +15,7 @@
if (!test_bit(CARD_HAS_PCCARD_ID, &(info->hw_state)))
return;
-@@ -176,7 +181,11 @@ static void bluecard_activity_led_timeou
+@@ -175,7 +180,11 @@ static void bluecard_activity_led_timeout(u_long arg)
static void bluecard_enable_activity_led(bluecard_info_t *info)
{
@@ -25,7 +27,7 @@
if (!test_bit(CARD_HAS_PCCARD_ID, &(info->hw_state)))
return;
-@@ -232,7 +241,11 @@ static void bluecard_write_wakeup(blueca
+@@ -231,7 +240,11 @@ static void bluecard_write_wakeup(bluecard_info_t *info)
}
do {
@@ -37,7 +39,7 @@
register unsigned int offset;
register unsigned char command;
register unsigned long ready_bit;
-@@ -379,7 +392,11 @@ static void bluecard_receive(bluecard_in
+@@ -378,7 +391,11 @@ static void bluecard_receive(bluecard_info_t *info, unsigned int offset)
return;
}
@@ -49,7 +51,7 @@
if (test_bit(XMIT_SENDING_READY, &(info->tx_state)))
bluecard_enable_activity_led(info);
-@@ -508,7 +525,11 @@ static irqreturn_t bluecard_interrupt(in
+@@ -507,7 +524,11 @@ static irqreturn_t bluecard_interrupt(int irq, void *dev_inst)
if (!test_bit(CARD_READY, &(info->hw_state)))
return IRQ_HANDLED;
@@ -61,7 +63,7 @@
spin_lock(&(info->lock));
-@@ -622,7 +643,11 @@ static int bluecard_hci_flush(struct hci
+@@ -621,7 +642,11 @@ static int bluecard_hci_flush(struct hci_dev *hdev)
static int bluecard_hci_open(struct hci_dev *hdev)
{
bluecard_info_t *info = (bluecard_info_t *)(hdev->driver_data);
@@ -73,7 +75,7 @@
if (test_bit(CARD_HAS_PCCARD_ID, &(info->hw_state)))
bluecard_hci_set_baud_rate(hdev, DEFAULT_BAUD_RATE);
-@@ -642,7 +667,11 @@ static int bluecard_hci_open(struct hci_
+@@ -641,7 +666,11 @@ static int bluecard_hci_open(struct hci_dev *hdev)
static int bluecard_hci_close(struct hci_dev *hdev)
{
bluecard_info_t *info = (bluecard_info_t *)(hdev->driver_data);
@@ -85,7 +87,7 @@
if (!test_and_clear_bit(HCI_RUNNING, &(hdev->flags)))
return 0;
-@@ -709,7 +738,11 @@ static int bluecard_hci_ioctl(struct hci
+@@ -708,7 +737,11 @@ static int bluecard_hci_ioctl(struct hci_dev *hdev, unsigned int cmd, unsigned l
static int bluecard_open(bluecard_info_t *info)
{
@@ -97,7 +99,7 @@
struct hci_dev *hdev;
unsigned char id;
-@@ -828,7 +861,11 @@ static int bluecard_open(bluecard_info_t
+@@ -827,7 +860,11 @@ static int bluecard_open(bluecard_info_t *info)
static int bluecard_close(bluecard_info_t *info)
{
@@ -109,7 +111,7 @@
struct hci_dev *hdev = info->hdev;
if (!hdev)
-@@ -865,6 +902,12 @@ static int bluecard_probe(struct pcmcia_
+@@ -864,7 +901,18 @@ static int bluecard_probe(struct pcmcia_device *link)
info->p_dev = link;
link->priv = info;
@@ -119,12 +121,24 @@
+ link->irq.Handler = bluecard_interrupt;
+#endif
+
- link->conf.Attributes = CONF_ENABLE_IRQ;
- link->conf.IntType = INT_MEMORY_AND_IO;
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
+ link->config_flags |= CONF_ENABLE_IRQ;
++#else
++ link->conf.Attributes = CONF_ENABLE_IRQ;
++ link->conf.IntType = INT_MEMORY_AND_IO;
++#endif
-@@ -888,13 +931,24 @@ static int bluecard_config(struct pcmcia
+ return bluecard_config(link);
+ }
+@@ -884,15 +932,30 @@ static int bluecard_config(struct pcmcia_device *link)
+ bluecard_info_t *info = link->priv;
+ int i, n;
- link->conf.ConfigIndex = 0x20;
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
+ link->config_index = 0x20;
++#else
++ link->conf.ConfigIndex = 0x20;
++#endif
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36))
link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
@@ -147,7 +161,7 @@
if (i == 0)
break;
}
-@@ -902,9 +956,15 @@ static int bluecard_config(struct pcmcia
+@@ -900,9 +963,15 @@ static int bluecard_config(struct pcmcia_device *link)
if (i != 0)
goto failed;
@@ -161,11 +175,27 @@
+ link->irq.AssignedIRQ = 0;
+#endif
- i = pcmcia_request_configuration(link, &link->conf);
+ i = pcmcia_enable_device(link);
if (i != 0)
+@@ -940,7 +1009,13 @@ MODULE_DEVICE_TABLE(pcmcia, bluecard_ids);
+
+ static struct pcmcia_driver bluecard_driver = {
+ .owner = THIS_MODULE,
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
+ .name = "bluecard_cs",
++#else
++ .drv = {
++ .name = "bluecard_cs",
++ },
++#endif
+ .probe = bluecard_probe,
+ .remove = bluecard_detach,
+ .id_table = bluecard_ids,
+diff --git a/drivers/bluetooth/bt3c_cs.c b/drivers/bluetooth/bt3c_cs.c
+index 0c8a655..cd6b493 100644
--- a/drivers/bluetooth/bt3c_cs.c
+++ b/drivers/bluetooth/bt3c_cs.c
-@@ -188,7 +188,11 @@ static void bt3c_write_wakeup(bt3c_info_
+@@ -187,7 +187,11 @@ static void bt3c_write_wakeup(bt3c_info_t *info)
return;
do {
@@ -177,7 +207,7 @@
register struct sk_buff *skb;
register int len;
-@@ -226,7 +230,11 @@ static void bt3c_receive(bt3c_info_t *in
+@@ -225,7 +229,11 @@ static void bt3c_receive(bt3c_info_t *info)
return;
}
@@ -189,7 +219,7 @@
avail = bt3c_read(iobase, 0x7006);
//printk("bt3c_cs: receiving %d bytes\n", avail);
-@@ -347,7 +355,11 @@ static irqreturn_t bt3c_interrupt(int ir
+@@ -346,7 +354,11 @@ static irqreturn_t bt3c_interrupt(int irq, void *dev_inst)
/* our irq handler is shared */
return IRQ_NONE;
@@ -201,7 +231,7 @@
spin_lock(&(info->lock));
-@@ -480,7 +492,11 @@ static int bt3c_load_firmware(bt3c_info_
+@@ -479,7 +491,11 @@ static int bt3c_load_firmware(bt3c_info_t *info, const unsigned char *firmware,
unsigned int iobase, size, addr, fcs, tmp;
int i, err = 0;
@@ -213,13 +243,17 @@
/* Reset */
bt3c_io_write(iobase, 0x8040, 0x0404);
-@@ -657,8 +673,19 @@ static int bt3c_probe(struct pcmcia_devi
+@@ -656,8 +672,27 @@ static int bt3c_probe(struct pcmcia_device *link)
info->p_dev = link;
link->priv = info;
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
+ link->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_SET_VPP |
+ CONF_AUTO_SET_IO;
++#else
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36))
- link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
- link->resource[0]->end = 8;
++ link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
++ link->resource[0]->end = 8;
+#else
+ link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
+ link->io.NumPorts1= 8;
@@ -230,50 +264,86 @@
+
+ link->irq.Handler = bt3c_interrupt;
+#endif
++
++ link->conf.Attributes = CONF_ENABLE_IRQ;
++ link->conf.IntType = INT_MEMORY_AND_IO;
++#endif
- link->conf.Attributes = CONF_ENABLE_IRQ;
- link->conf.IntType = INT_MEMORY_AND_IO;
-@@ -683,14 +710,23 @@ static int bt3c_check_config(struct pcmc
- {
- unsigned long try = (unsigned long) priv_data;
+ return bt3c_config(link);
+ }
+@@ -671,6 +706,7 @@ static void bt3c_detach(struct pcmcia_device *link)
+ kfree(info);
+ }
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
+ static int bt3c_check_config(struct pcmcia_device *p_dev, void *priv_data)
+ {
+ int *try = priv_data;
+@@ -709,6 +745,63 @@ static int bt3c_check_config_notpicky(struct pcmcia_device *p_dev,
+ }
+ return -ENODEV;
+ }
++#else
++static int bt3c_check_config(struct pcmcia_device *p_dev,
++ cistpl_cftable_entry_t *cf,
++ cistpl_cftable_entry_t *dflt,
++ unsigned int vcc,
++ void *priv_data)
++{
++ unsigned long try = (unsigned long) priv_data;
++
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36))
- p_dev->io_lines = (try == 0) ? 16 : cf->io.flags & CISTPL_IO_LINES_MASK;
++ p_dev->io_lines = (try == 0) ? 16 : cf->io.flags & CISTPL_IO_LINES_MASK;
+#endif
-
- if (cf->vpp1.present & (1 << CISTPL_POWER_VNOM))
- p_dev->conf.Vpp = cf->vpp1.param[CISTPL_POWER_VNOM] / 10000;
- if ((cf->io.nwin > 0) && (cf->io.win[0].len == 8) &&
- (cf->io.win[0].base != 0)) {
++
++ if (cf->vpp1.present & (1 << CISTPL_POWER_VNOM))
++ p_dev->conf.Vpp = cf->vpp1.param[CISTPL_POWER_VNOM] / 10000;
++ if ((cf->io.nwin > 0) && (cf->io.win[0].len == 8) &&
++ (cf->io.win[0].base != 0)) {
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36))
- p_dev->resource[0]->start = cf->io.win[0].base;
- if (!pcmcia_request_io(p_dev))
++ p_dev->resource[0]->start = cf->io.win[0].base;
++ if (!pcmcia_request_io(p_dev))
+#else
+ p_dev->io.BasePort1 = cf->io.win[0].base;
+ p_dev->io.IOAddrLines = (try == 0) ? 16 :
+ cf->io.flags & CISTPL_IO_LINES_MASK;
+ if (!pcmcia_request_io(p_dev, &p_dev->io))
+#endif
- return 0;
- }
- return -ENODEV;
-@@ -707,9 +743,15 @@ static int bt3c_check_config_notpicky(st
-
- if ((cf->io.nwin > 0) && ((cf->io.flags & CISTPL_IO_LINES_MASK) <= 3)) {
- for (j = 0; j < 5; j++) {
++ return 0;
++ }
++ return -ENODEV;
++}
++
++static int bt3c_check_config_notpicky(struct pcmcia_device *p_dev,
++ cistpl_cftable_entry_t *cf,
++ cistpl_cftable_entry_t *dflt,
++ unsigned int vcc,
++ void *priv_data)
++{
++ static unsigned int base[5] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8, 0x0 };
++ int j;
++
++ if ((cf->io.nwin > 0) && ((cf->io.flags & CISTPL_IO_LINES_MASK) <= 3)) {
++ for (j = 0; j < 5; j++) {
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36))
- p_dev->resource[0]->start = base[j];
- p_dev->io_lines = base[j] ? 16 : 3;
- if (!pcmcia_request_io(p_dev))
++ p_dev->resource[0]->start = base[j];
++ p_dev->io_lines = base[j] ? 16 : 3;
++ if (!pcmcia_request_io(p_dev))
+#else
+ p_dev->io.BasePort1 = base[j];
+ p_dev->io.IOAddrLines = base[j] ? 16 : 3;
+ if (!pcmcia_request_io(p_dev, &p_dev->io))
+#endif
- return 0;
- }
- }
-@@ -738,9 +780,15 @@ static int bt3c_config(struct pcmcia_dev
++ return 0;
++ }
++ }
++ return -ENODEV;
++}
++#endif
+
+ static int bt3c_config(struct pcmcia_device *link)
+ {
+@@ -732,9 +825,15 @@ static int bt3c_config(struct pcmcia_device *link)
goto failed;
found_port:
@@ -287,11 +357,27 @@
+ link->irq.AssignedIRQ = 0;
+#endif
- i = pcmcia_request_configuration(link, &link->conf);
+ i = pcmcia_enable_device(link);
if (i != 0)
+@@ -769,7 +868,13 @@ MODULE_DEVICE_TABLE(pcmcia, bt3c_ids);
+
+ static struct pcmcia_driver bt3c_driver = {
+ .owner = THIS_MODULE,
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
+ .name = "bt3c_cs",
++#else
++ .drv = {
++ .name = "bt3c_cs",
++ },
++#endif
+ .probe = bt3c_probe,
+ .remove = bt3c_detach,
+ .id_table = bt3c_ids,
+diff --git a/drivers/bluetooth/btuart_cs.c b/drivers/bluetooth/btuart_cs.c
+index f8a0708..3d2a7d1 100644
--- a/drivers/bluetooth/btuart_cs.c
+++ b/drivers/bluetooth/btuart_cs.c
-@@ -142,7 +142,11 @@ static void btuart_write_wakeup(btuart_i
+@@ -141,7 +141,11 @@ static void btuart_write_wakeup(btuart_info_t *info)
}
do {
@@ -303,7 +389,7 @@
register struct sk_buff *skb;
register int len;
-@@ -183,7 +187,11 @@ static void btuart_receive(btuart_info_t
+@@ -182,7 +186,11 @@ static void btuart_receive(btuart_info_t *info)
return;
}
@@ -315,7 +401,7 @@
do {
info->hdev->stat.byte_rx++;
-@@ -297,7 +305,11 @@ static irqreturn_t btuart_interrupt(int
+@@ -296,7 +304,11 @@ static irqreturn_t btuart_interrupt(int irq, void *dev_inst)
/* our irq handler is shared */
return IRQ_NONE;
@@ -327,7 +413,7 @@
spin_lock(&(info->lock));
-@@ -354,7 +366,11 @@ static void btuart_change_speed(btuart_i
+@@ -353,7 +365,11 @@ static void btuart_change_speed(btuart_info_t *info, unsigned int speed)
return;
}
@@ -339,7 +425,7 @@
spin_lock_irqsave(&(info->lock), flags);
-@@ -478,7 +494,11 @@ static int btuart_hci_ioctl(struct hci_d
+@@ -477,7 +493,11 @@ static int btuart_hci_ioctl(struct hci_dev *hdev, unsigned int cmd, unsigned lon
static int btuart_open(btuart_info_t *info)
{
unsigned long flags;
@@ -351,7 +437,7 @@
struct hci_dev *hdev;
spin_lock_init(&(info->lock));
-@@ -548,7 +568,11 @@ static int btuart_open(btuart_info_t *in
+@@ -547,7 +567,11 @@ static int btuart_open(btuart_info_t *info)
static int btuart_close(btuart_info_t *info)
{
unsigned long flags;
@@ -363,13 +449,17 @@
struct hci_dev *hdev = info->hdev;
if (!hdev)
-@@ -586,8 +610,19 @@ static int btuart_probe(struct pcmcia_de
+@@ -585,8 +609,27 @@ static int btuart_probe(struct pcmcia_device *link)
info->p_dev = link;
link->priv = info;
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
+ link->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_SET_VPP |
+ CONF_AUTO_SET_IO;
++#else
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36))
- link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
- link->resource[0]->end = 8;
++ link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
++ link->resource[0]->end = 8;
+#else
+ link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
+ link->io.NumPorts1= 8;
@@ -380,50 +470,86 @@
+
+ link->irq.Handler = btuart_interrupt;
+#endif
++
++ link->conf.Attributes = CONF_ENABLE_IRQ;
++ link->conf.IntType = INT_MEMORY_AND_IO;
++#endif
+
+ return btuart_config(link);
+ }
+@@ -600,6 +643,7 @@ static void btuart_detach(struct pcmcia_device *link)
+ kfree(info);
+ }
- link->conf.Attributes = CONF_ENABLE_IRQ;
- link->conf.IntType = INT_MEMORY_AND_IO;
-@@ -612,14 +647,23 @@ static int btuart_check_config(struct pc
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
+ static int btuart_check_config(struct pcmcia_device *p_dev, void *priv_data)
{
int *try = priv_data;
-
+@@ -638,6 +682,63 @@ static int btuart_check_config_notpicky(struct pcmcia_device *p_dev,
+ }
+ return -ENODEV;
+ }
++#else
++static int btuart_check_config(struct pcmcia_device *p_dev,
++ cistpl_cftable_entry_t *cf,
++ cistpl_cftable_entry_t *dflt,
++ unsigned int vcc,
++ void *priv_data)
++{
++ int *try = priv_data;
++
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36))
- p_dev->io_lines = (try == 0) ? 16 : cf->io.flags & CISTPL_IO_LINES_MASK;
++ p_dev->io_lines = (try == 0) ? 16 : cf->io.flags & CISTPL_IO_LINES_MASK;
+#endif
-
- if (cf->vpp1.present & (1 << CISTPL_POWER_VNOM))
- p_dev->conf.Vpp = cf->vpp1.param[CISTPL_POWER_VNOM] / 10000;
- if ((cf->io.nwin > 0) && (cf->io.win[0].len == 8) &&
- (cf->io.win[0].base != 0)) {
++
++ if (cf->vpp1.present & (1 << CISTPL_POWER_VNOM))
++ p_dev->conf.Vpp = cf->vpp1.param[CISTPL_POWER_VNOM] / 10000;
++ if ((cf->io.nwin > 0) && (cf->io.win[0].len == 8) &&
++ (cf->io.win[0].base != 0)) {
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36))
- p_dev->resource[0]->start = cf->io.win[0].base;
- if (!pcmcia_request_io(p_dev))
++ p_dev->resource[0]->start = cf->io.win[0].base;
++ if (!pcmcia_request_io(p_dev))
+#else
+ p_dev->io.BasePort1 = cf->io.win[0].base;
+ p_dev->io.IOAddrLines = (*try == 0) ? 16 :
+ cf->io.flags & CISTPL_IO_LINES_MASK;
+ if (!pcmcia_request_io(p_dev, &p_dev->io))
+#endif
- return 0;
- }
- return -ENODEV;
-@@ -636,9 +680,15 @@ static int btuart_check_config_notpicky(
-
- if ((cf->io.nwin > 0) && ((cf->io.flags & CISTPL_IO_LINES_MASK) <= 3)) {
- for (j = 0; j < 5; j++) {
++ return 0;
++ }
++ return -ENODEV;
++}
++
++static int btuart_check_config_notpicky(struct pcmcia_device *p_dev,
++ cistpl_cftable_entry_t *cf,
++ cistpl_cftable_entry_t *dflt,
++ unsigned int vcc,
++ void *priv_data)
++{
++ static unsigned int base[5] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8, 0x0 };
++ int j;
++
++ if ((cf->io.nwin > 0) && ((cf->io.flags & CISTPL_IO_LINES_MASK) <= 3)) {
++ for (j = 0; j < 5; j++) {
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36))
- p_dev->resource[0]->start = base[j];
- p_dev->io_lines = base[j] ? 16 : 3;
- if (!pcmcia_request_io(p_dev))
++ p_dev->resource[0]->start = base[j];
++ p_dev->io_lines = base[j] ? 16 : 3;
++ if (!pcmcia_request_io(p_dev))
+#else
+ p_dev->io.BasePort1 = base[j];
+ p_dev->io.IOAddrLines = base[j] ? 16 : 3;
+ if (!pcmcia_request_io(p_dev, &p_dev->io))
+#endif
- return 0;
- }
- }
-@@ -667,9 +717,15 @@ static int btuart_config(struct pcmcia_d
++ return 0;
++ }
++ }
++ return -ENODEV;
++}
++#endif
+
+ static int btuart_config(struct pcmcia_device *link)
+ {
+@@ -661,9 +762,15 @@ static int btuart_config(struct pcmcia_device *link)
goto failed;
found_port:
@@ -437,11 +563,27 @@
+ link->irq.AssignedIRQ = 0;
+#endif
- i = pcmcia_request_configuration(link, &link->conf);
+ i = pcmcia_enable_device(link);
if (i != 0)
+@@ -697,7 +804,13 @@ MODULE_DEVICE_TABLE(pcmcia, btuart_ids);
+
+ static struct pcmcia_driver btuart_driver = {
+ .owner = THIS_MODULE,
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
+ .name = "btuart_cs",
++#else
++ .drv = {
++ .name = "btuart_cs",
++ },
++#endif
+ .probe = btuart_probe,
+ .remove = btuart_detach,
+ .id_table = btuart_ids,
+diff --git a/drivers/bluetooth/dtl1_cs.c b/drivers/bluetooth/dtl1_cs.c
+index 26ee0cf..c913f6b 100644
--- a/drivers/bluetooth/dtl1_cs.c
+++ b/drivers/bluetooth/dtl1_cs.c
-@@ -149,7 +149,11 @@ static void dtl1_write_wakeup(dtl1_info_
+@@ -148,7 +148,11 @@ static void dtl1_write_wakeup(dtl1_info_t *info)
}
do {
@@ -453,7 +595,7 @@
register struct sk_buff *skb;
register int len;
-@@ -214,7 +218,11 @@ static void dtl1_receive(dtl1_info_t *in
+@@ -213,7 +217,11 @@ static void dtl1_receive(dtl1_info_t *info)
return;
}
@@ -465,7 +607,7 @@
do {
info->hdev->stat.byte_rx++;
-@@ -301,7 +309,11 @@ static irqreturn_t dtl1_interrupt(int ir
+@@ -300,7 +308,11 @@ static irqreturn_t dtl1_interrupt(int irq, void *dev_inst)
/* our irq handler is shared */
return IRQ_NONE;
@@ -477,7 +619,7 @@
spin_lock(&(info->lock));
-@@ -461,7 +473,11 @@ static int dtl1_hci_ioctl(struct hci_dev
+@@ -460,7 +472,11 @@ static int dtl1_hci_ioctl(struct hci_dev *hdev, unsigned int cmd, unsigned long
static int dtl1_open(dtl1_info_t *info)
{
unsigned long flags;
@@ -489,7 +631,7 @@
struct hci_dev *hdev;
spin_lock_init(&(info->lock));
-@@ -508,8 +524,13 @@ static int dtl1_open(dtl1_info_t *info)
+@@ -507,8 +523,13 @@ static int dtl1_open(dtl1_info_t *info)
outb(UART_LCR_WLEN8, iobase + UART_LCR); /* Reset DLAB */
outb((UART_MCR_DTR | UART_MCR_RTS | UART_MCR_OUT2), iobase + UART_MCR);
@@ -503,7 +645,7 @@
/* Turn on interrupts */
outb(UART_IER_RLSI | UART_IER_RDI | UART_IER_THRI, iobase + UART_IER);
-@@ -534,7 +555,11 @@ static int dtl1_open(dtl1_info_t *info)
+@@ -533,7 +554,11 @@ static int dtl1_open(dtl1_info_t *info)
static int dtl1_close(dtl1_info_t *info)
{
unsigned long flags;
@@ -515,13 +657,16 @@
struct hci_dev *hdev = info->hdev;
if (!hdev)
-@@ -572,8 +597,17 @@ static int dtl1_probe(struct pcmcia_devi
+@@ -571,7 +596,24 @@ static int dtl1_probe(struct pcmcia_device *link)
info->p_dev = link;
link->priv = info;
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
+ link->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_SET_IO;
++#else
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36))
- link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
- link->resource[0]->end = 8;
++ link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
++ link->resource[0]->end = 8;
+#else
+ link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
+ link->io.NumPorts1= 8;
@@ -530,28 +675,52 @@
+ link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
+ link->irq.Handler = dtl1_interrupt;
+#endif
++
++ link->conf.Attributes = CONF_ENABLE_IRQ;
++ link->conf.IntType = INT_MEMORY_AND_IO;
++#endif
- link->conf.Attributes = CONF_ENABLE_IRQ;
- link->conf.IntType = INT_MEMORY_AND_IO;
-@@ -600,10 +634,17 @@ static int dtl1_confcheck(struct pcmcia_
- if ((cf->io.nwin != 1) || (cf->io.win[0].len <= 8))
- return -ENODEV;
+ return dtl1_config(link);
+ }
+@@ -586,6 +628,7 @@ static void dtl1_detach(struct pcmcia_device *link)
+ kfree(info);
+ }
+
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
+ static int dtl1_confcheck(struct pcmcia_device *p_dev, void *priv_data)
+ {
+ if ((p_dev->resource[1]->end) || (p_dev->resource[1]->end < 8))
+@@ -596,6 +639,29 @@ static int dtl1_confcheck(struct pcmcia_device *p_dev, void *priv_data)
-+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36))
- p_dev->resource[0]->start = cf->io.win[0].base;
- p_dev->resource[0]->end = cf->io.win[0].len; /*yo */
- p_dev->io_lines = cf->io.flags & CISTPL_IO_LINES_MASK;
return pcmcia_request_io(p_dev);
+ }
++#else
++static int dtl1_confcheck(struct pcmcia_device *p_dev,
++ cistpl_cftable_entry_t *cf,
++ cistpl_cftable_entry_t *dflt,
++ unsigned int vcc,
++ void *priv_data)
++{
++ if ((cf->io.nwin != 1) || (cf->io.win[0].len <= 8))
++ return -ENODEV;
++
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36))
++ p_dev->resource[0]->start = cf->io.win[0].base;
++ p_dev->resource[0]->end = cf->io.win[0].len; /*yo */
++ p_dev->io_lines = cf->io.flags & CISTPL_IO_LINES_MASK;
++ return pcmcia_request_io(p_dev);
+#else
+ p_dev->io.BasePort1 = cf->io.win[0].base;
+ p_dev->io.NumPorts1 = cf->io.win[0].len; /*yo */
+ p_dev->io.IOAddrLines = cf->io.flags & CISTPL_IO_LINES_MASK;
+ return pcmcia_request_io(p_dev, &p_dev->io);
+#endif
- }
++}
++#endif
static int dtl1_config(struct pcmcia_device *link)
-@@ -612,13 +653,23 @@ static int dtl1_config(struct pcmcia_dev
+ {
+@@ -603,13 +669,23 @@ static int dtl1_config(struct pcmcia_device *link)
int i;
/* Look for a generic full-sized window */
@@ -573,11 +742,67 @@
+ link->irq.AssignedIRQ = 0;
+#endif
- i = pcmcia_request_configuration(link, &link->conf);
+ i = pcmcia_enable_device(link);
if (i != 0)
+@@ -647,7 +723,13 @@ MODULE_DEVICE_TABLE(pcmcia, dtl1_ids);
+
+ static struct pcmcia_driver dtl1_driver = {
+ .owner = THIS_MODULE,
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
+ .name = "dtl1_cs",
++#else
++ .drv = {
++ .name = "dtl1_cs",
++ },
++#endif
+ .probe = dtl1_probe,
+ .remove = dtl1_detach,
+ .id_table = dtl1_ids,
+diff --git a/drivers/net/wireless/b43/pcmcia.c b/drivers/net/wireless/b43/pcmcia.c
+index 7dcba5f..9b8db4d 100644
--- a/drivers/net/wireless/b43/pcmcia.c
+++ b/drivers/net/wireless/b43/pcmcia.c
-@@ -89,7 +89,14 @@ static int __devinit b43_pcmcia_probe(st
+@@ -62,6 +62,9 @@ static int b43_pcmcia_resume(struct pcmcia_device *dev)
+ static int __devinit b43_pcmcia_probe(struct pcmcia_device *dev)
+ {
+ struct ssb_bus *ssb;
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37))
++ win_req_t win;
++#endif
+ int err = -ENOMEM;
+ int res = 0;
+
+@@ -71,6 +74,7 @@ static int __devinit b43_pcmcia_probe(struct pcmcia_device *dev)
+
+ err = -ENODEV;
+
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
+ dev->config_flags |= CONF_ENABLE_IRQ;
+
+ dev->resource[2]->flags |= WIN_ENABLE | WIN_DATA_WIDTH_16 |
+@@ -78,21 +82,46 @@ static int __devinit b43_pcmcia_probe(struct pcmcia_device *dev)
+ dev->resource[2]->start = 0;
+ dev->resource[2]->end = SSB_CORE_SIZE;
+ res = pcmcia_request_window(dev, dev->resource[2], 250);
++#else
++ dev->conf.Attributes = CONF_ENABLE_IRQ;
++ dev->conf.IntType = INT_MEMORY_AND_IO;
++
++ win.Attributes = WIN_ENABLE | WIN_DATA_WIDTH_16 |
++ WIN_USE_WAIT;
++ win.Base = 0;
++ win.Size = SSB_CORE_SIZE;
++ win.AccessSpeed = 250;
++ res = pcmcia_request_window(dev, &win, &dev->win);
++#endif
+ if (res != 0)
+ goto err_kfree_ssb;
+-
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
+ res = pcmcia_map_mem_page(dev, dev->resource[2], 0);
++#else
++ res = pcmcia_map_mem_page(dev, dev->win, 0);
++#endif
if (res != 0)
goto err_disable;
@@ -591,10 +816,37 @@
+#endif
goto err_disable;
- res = pcmcia_request_configuration(dev, &dev->conf);
+ res = pcmcia_enable_device(dev);
+ if (res != 0)
+ goto err_disable;
+
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
+ err = ssb_bus_pcmciabus_register(ssb, dev, dev->resource[2]->start);
++#else
++ err = ssb_bus_pcmciabus_register(ssb, dev, win.Base);
++#endif
+ if (err)
+ goto err_disable;
+ dev->priv = ssb;
+@@ -121,7 +150,13 @@ static void __devexit b43_pcmcia_remove(struct pcmcia_device *dev)
+
+ static struct pcmcia_driver b43_pcmcia_driver = {
+ .owner = THIS_MODULE,
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
+ .name = "b43-pcmcia",
++#else
++ .drv = {
++ .name = "b43-pcmcia",
++ },
++#endif
+ .id_table = b43_pcmcia_tbl,
+ .probe = b43_pcmcia_probe,
+ .remove = __devexit_p(b43_pcmcia_remove),
+diff --git a/drivers/net/wireless/libertas/if_cs.c b/drivers/net/wireless/libertas/if_cs.c
+index fc81211..e9520de 100644
--- a/drivers/net/wireless/libertas/if_cs.c
+++ b/drivers/net/wireless/libertas/if_cs.c
-@@ -774,7 +774,11 @@ static void if_cs_release(struct pcmcia_
+@@ -764,7 +764,11 @@ static void if_cs_release(struct pcmcia_device *p_dev)
lbs_deb_enter(LBS_DEB_CS);
@@ -606,24 +858,45 @@
pcmcia_disable_device(p_dev);
if (card->iobase)
ioport_unmap(card->iobase);
-@@ -799,9 +803,15 @@ static int if_cs_ioprobe(struct pcmcia_d
- unsigned int vcc,
- void *priv_data)
+@@ -772,7 +776,7 @@ static void if_cs_release(struct pcmcia_device *p_dev)
+ lbs_deb_leave(LBS_DEB_CS);
+ }
+
+-
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
+ static int if_cs_ioprobe(struct pcmcia_device *p_dev, void *priv_data)
{
+ p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH;
+@@ -782,9 +786,39 @@ static int if_cs_ioprobe(struct pcmcia_device *p_dev, void *priv_data)
+ lbs_pr_err("wrong CIS (check number of IO windows)\n");
+ return -ENODEV;
+ }
++#else
++static int if_cs_ioprobe(struct pcmcia_device *p_dev,
++ cistpl_cftable_entry_t *cfg,
++ cistpl_cftable_entry_t *dflt,
++ unsigned int vcc,
++ void *priv_data)
++{
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36))
- p_dev->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
- p_dev->resource[0]->start = cfg->io.win[0].base;
- p_dev->resource[0]->end = cfg->io.win[0].len;
++ p_dev->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
++ p_dev->resource[0]->start = cfg->io.win[0].base;
++ p_dev->resource[0]->end = cfg->io.win[0].len;
+#else
+ p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
+ p_dev->io.BasePort1 = cfg->io.win[0].base;
+ p_dev->io.NumPorts1 = cfg->io.win[0].len;
+#endif
-
- /* Do we need to allocate an interrupt? */
- p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
-@@ -813,7 +823,11 @@ static int if_cs_ioprobe(struct pcmcia_d
- }
++
++ /* Do we need to allocate an interrupt? */
++ p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
++
++ /* IO window settings */
++ if (cfg->io.nwin != 1) {
++ lbs_pr_err("wrong CIS (check number of IO windows)\n");
++ return -ENODEV;
++ }
++#endif
/* This reserves IO space but doesn't actually enable it */
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36))
@@ -634,19 +907,24 @@
}
static int if_cs_probe(struct pcmcia_device *p_dev)
-@@ -835,6 +849,11 @@ static int if_cs_probe(struct pcmcia_dev
+@@ -806,7 +840,16 @@ static int if_cs_probe(struct pcmcia_device *p_dev)
card->p_dev = p_dev;
p_dev->priv = card;
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
+ p_dev->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_SET_IO;
++#else
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35))
+ p_dev->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
+ p_dev->irq.Handler = NULL;
+#endif
-+
- p_dev->conf.Attributes = 0;
- p_dev->conf.IntType = INT_MEMORY_AND_IO;
++ p_dev->conf.Attributes = 0;
++ p_dev->conf.IntType = INT_MEMORY_AND_IO;
++#endif
-@@ -848,12 +867,26 @@ static int if_cs_probe(struct pcmcia_dev
+ if (pcmcia_loop_config(p_dev, if_cs_ioprobe, NULL)) {
+ lbs_pr_err("error in pcmcia_loop_config\n");
+@@ -818,12 +861,26 @@ static int if_cs_probe(struct pcmcia_device *p_dev)
* a handler to the interrupt, unless the 'Handler' member of
* the irq structure is initialized.
*/
@@ -673,7 +951,7 @@
if (!card->iobase) {
lbs_pr_err("error in ioport_map\n");
ret = -EIO;
-@@ -872,7 +905,17 @@ static int if_cs_probe(struct pcmcia_dev
+@@ -837,7 +894,17 @@ static int if_cs_probe(struct pcmcia_device *p_dev)
}
/* Finally, report what we've done */
@@ -691,7 +969,7 @@
/*
* Most of the libertas cards can do unaligned register access, but some
-@@ -941,7 +984,11 @@ static int if_cs_probe(struct pcmcia_dev
+@@ -906,7 +973,11 @@ static int if_cs_probe(struct pcmcia_device *p_dev)
priv->fw_ready = 1;
/* Now actually get the IRQ */
@@ -703,9 +981,25 @@
IRQF_SHARED, DRV_NAME, card);
if (ret) {
lbs_pr_err("error in request_irq\n");
+@@ -977,7 +1048,13 @@ MODULE_DEVICE_TABLE(pcmcia, if_cs_ids);
+
+ static struct pcmcia_driver lbs_driver = {
+ .owner = THIS_MODULE,
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
+ .name = DRV_NAME,
++#else
++ .drv = {
++ .name = DRV_NAME,
++ },
++#endif
+ .probe = if_cs_probe,
+ .remove = if_cs_detach,
+ .id_table = if_cs_ids,
+diff --git a/drivers/net/wireless/orinoco/orinoco_cs.c b/drivers/net/wireless/orinoco/orinoco_cs.c
+index 71b3d68..7425e1e 100644
--- a/drivers/net/wireless/orinoco/orinoco_cs.c
+++ b/drivers/net/wireless/orinoco/orinoco_cs.c
-@@ -79,7 +79,11 @@ orinoco_cs_hard_reset(struct orinoco_pri
+@@ -78,7 +78,11 @@ orinoco_cs_hard_reset(struct orinoco_private *priv)
/* We need atomic ops here, because we're not holding the lock */
set_bit(0, &card->hard_reset_in_progress);
@@ -717,7 +1011,7 @@
if (err)
return err;
-@@ -117,6 +121,12 @@ orinoco_cs_probe(struct pcmcia_device *l
+@@ -108,6 +112,16 @@ orinoco_cs_probe(struct pcmcia_device *link)
card->p_dev = link;
link->priv = priv;
@@ -726,28 +1020,81 @@
+ link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
+ link->irq.Handler = orinoco_interrupt;
+#endif
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37))
++ link->conf.Attributes = 0;
++ link->conf.IntType = INT_MEMORY_AND_IO;
++#endif
+
- /* 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.,
-@@ -191,23 +201,48 @@ static int orinoco_cs_config_check(struc
- p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
+ return orinoco_cs_config(link);
+ } /* orinoco_cs_attach */
+
+@@ -122,6 +136,7 @@ static void orinoco_cs_detach(struct pcmcia_device *link)
+ free_orinocodev(priv);
+ } /* orinoco_cs_detach */
- /* IO window settings */
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
+ static int orinoco_cs_config_check(struct pcmcia_device *p_dev, void *priv_data)
+ {
+ if (p_dev->config_index == 0)
+@@ -129,6 +144,98 @@ static int orinoco_cs_config_check(struct pcmcia_device *p_dev, void *priv_data)
+
+ return pcmcia_request_io(p_dev);
+ };
++#else
++static int orinoco_cs_config_check(struct pcmcia_device *p_dev,
++ cistpl_cftable_entry_t *cfg,
++ cistpl_cftable_entry_t *dflt,
++ unsigned int vcc,
++ void *priv_data)
++{
++ if (cfg->index == 0)
++ goto next_entry;
++
++ /* Use power settings for Vcc and Vpp if present */
++ /* Note that the CIS values need to be rescaled */
++ if (cfg->vcc.present & (1 << CISTPL_POWER_VNOM)) {
++ if (vcc != cfg->vcc.param[CISTPL_POWER_VNOM] / 10000) {
++ DEBUG(2, "%s: Vcc mismatch (vcc = %d, CIS = %d)\n",
++ __func__, vcc,
++ cfg->vcc.param[CISTPL_POWER_VNOM] / 10000);
++ if (!ignore_cis_vcc)
++ goto next_entry;
++ }
++ } else if (dflt->vcc.present & (1 << CISTPL_POWER_VNOM)) {
++ if (vcc != dflt->vcc.param[CISTPL_POWER_VNOM] / 10000) {
++ DEBUG(2, "%s: Vcc mismatch (vcc = %d, CIS = %d)\n",
++ __func__, vcc,
++ dflt->vcc.param[CISTPL_POWER_VNOM] / 10000);
++ if (!ignore_cis_vcc)
++ goto next_entry;
++ }
++ }
++
++ if (cfg->vpp1.present & (1 << CISTPL_POWER_VNOM))
++ p_dev->conf.Vpp =
++ cfg->vpp1.param[CISTPL_POWER_VNOM] / 10000;
++ else if (dflt->vpp1.present & (1 << CISTPL_POWER_VNOM))
++ p_dev->conf.Vpp =
++ dflt->vpp1.param[CISTPL_POWER_VNOM] / 10000;
++
++ /* Do we need to allocate an interrupt? */
++ 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;
++ 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 ((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;
++ 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))
@@ -758,28 +1105,50 @@
+ p_dev->io.BasePort1 = io->win[0].base;
+ p_dev->io.NumPorts1 = io->win[0].len;
+#endif
- if (io->nwin > 1) {
++ 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;
++ 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 */
++ }
++
++ /* 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)
++ 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 next_entry;
++ }
++ return 0;
++
++next_entry:
++ pcmcia_disable_device(p_dev);
++ return -ENODEV;
++};
++#endif
+
+ static int
+ orinoco_cs_config(struct pcmcia_device *link)
+@@ -138,10 +245,12 @@ orinoco_cs_config(struct pcmcia_device *link)
+ int ret;
+ void __iomem *mem;
+
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
+ link->config_flags |= CONF_AUTO_SET_VPP | CONF_AUTO_CHECK_VCC |
+ CONF_AUTO_SET_IO | CONF_ENABLE_IRQ;
+ if (ignore_cis_vcc)
+ link->config_flags &= ~CONF_AUTO_CHECK_VCC;
++#endif
+ ret = pcmcia_loop_config(link, orinoco_cs_config_check, NULL);
+ if (ret) {
+ if (!ignore_cis_vcc)
+@@ -151,15 +260,23 @@ orinoco_cs_config(struct pcmcia_device *link)
goto failed;
}
@@ -803,7 +1172,7 @@
if (!mem)
goto failed;
-@@ -278,8 +321,16 @@ orinoco_cs_config(struct pcmcia_device *
+@@ -176,8 +293,16 @@ orinoco_cs_config(struct pcmcia_device *link)
}
/* Register an interface with the stack */
@@ -820,9 +1189,25 @@
printk(KERN_ERR PFX "orinoco_if_add() failed\n");
goto failed;
}
+@@ -328,7 +453,13 @@ MODULE_DEVICE_TABLE(pcmcia, orinoco_cs_ids);
+
+ static struct pcmcia_driver orinoco_driver = {
+ .owner = THIS_MODULE,
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
+ .name = DRIVER_NAME,
++#else
++ .drv = {
++ .name = DRIVER_NAME,
++ },
++#endif
+ .probe = orinoco_cs_probe,
+ .remove = orinoco_cs_detach,
+ .id_table = orinoco_cs_ids,
+diff --git a/drivers/net/wireless/orinoco/spectrum_cs.c b/drivers/net/wireless/orinoco/spectrum_cs.c
+index fb859a5..30d033c 100644
--- a/drivers/net/wireless/orinoco/spectrum_cs.c
+++ b/drivers/net/wireless/orinoco/spectrum_cs.c
-@@ -179,6 +179,12 @@ spectrum_cs_probe(struct pcmcia_device *
+@@ -170,6 +170,16 @@ spectrum_cs_probe(struct pcmcia_device *link)
card->p_dev = link;
link->priv = priv;
@@ -831,28 +1216,81 @@
+ link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
+ link->irq.Handler = orinoco_interrupt;
+#endif
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37))
++ link->conf.Attributes = 0;
++ link->conf.IntType = INT_MEMORY_AND_IO;
++#endif
+
- /* 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.,
-@@ -253,23 +259,48 @@ static int spectrum_cs_config_check(stru
- p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
+ return spectrum_cs_config(link);
+ } /* spectrum_cs_attach */
+
+@@ -184,6 +194,7 @@ static void spectrum_cs_detach(struct pcmcia_device *link)
+ free_orinocodev(priv);
+ } /* spectrum_cs_detach */
+
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
+ static int spectrum_cs_config_check(struct pcmcia_device *p_dev,
+ void *priv_data)
+ {
+@@ -192,6 +203,98 @@ static int spectrum_cs_config_check(struct pcmcia_device *p_dev,
- /* IO window settings */
+ return pcmcia_request_io(p_dev);
+ };
++#else
++static int spectrum_cs_config_check(struct pcmcia_device *p_dev,
++ cistpl_cftable_entry_t *cfg,
++ cistpl_cftable_entry_t *dflt,
++ unsigned int vcc,
++ void *priv_data)
++{
++ if (cfg->index == 0)
++ goto next_entry;
++
++ /* Use power settings for Vcc and Vpp if present */
++ /* Note that the CIS values need to be rescaled */
++ if (cfg->vcc.present & (1 << CISTPL_POWER_VNOM)) {
++ if (vcc != cfg->vcc.param[CISTPL_POWER_VNOM] / 10000) {
++ DEBUG(2, "%s: Vcc mismatch (vcc = %d, CIS = %d)\n",
++ __func__, vcc,
++ cfg->vcc.param[CISTPL_POWER_VNOM] / 10000);
++ if (!ignore_cis_vcc)
++ goto next_entry;
++ }
++ } else if (dflt->vcc.present & (1 << CISTPL_POWER_VNOM)) {
++ if (vcc != dflt->vcc.param[CISTPL_POWER_VNOM] / 10000) {
++ DEBUG(2, "%s: Vcc mismatch (vcc = %d, CIS = %d)\n",
++ __func__, vcc,
++ dflt->vcc.param[CISTPL_POWER_VNOM] / 10000);
++ if (!ignore_cis_vcc)
++ goto next_entry;
++ }
++ }
++
++ if (cfg->vpp1.present & (1 << CISTPL_POWER_VNOM))
++ p_dev->conf.Vpp =
++ cfg->vpp1.param[CISTPL_POWER_VNOM] / 10000;
++ else if (dflt->vpp1.present & (1 << CISTPL_POWER_VNOM))
++ p_dev->conf.Vpp =
++ dflt->vpp1.param[CISTPL_POWER_VNOM] / 10000;
++
++ /* Do we need to allocate an interrupt? */
++ 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;
++ 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 ((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;
++ 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))
@@ -863,28 +1301,50 @@
+ p_dev->io.BasePort1 = io->win[0].base;
+ p_dev->io.NumPorts1 = io->win[0].len;
+#endif
- if (io->nwin > 1) {
++ 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;
++ 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 */
++ }
++
++ /* 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)
++ 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 next_entry;
++ }
++ return 0;
++
++next_entry:
++ pcmcia_disable_device(p_dev);
++ return -ENODEV;
++};
++#endif
+
+ static int
+ spectrum_cs_config(struct pcmcia_device *link)
+@@ -201,10 +304,12 @@ spectrum_cs_config(struct pcmcia_device *link)
+ int ret;
+ void __iomem *mem;
+
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
+ link->config_flags |= CONF_AUTO_SET_VPP | CONF_AUTO_CHECK_VCC |
+ CONF_AUTO_SET_IO | CONF_ENABLE_IRQ;
+ if (ignore_cis_vcc)
+ link->config_flags &= ~CONF_AUTO_CHECK_VCC;
++#endif
+ ret = pcmcia_loop_config(link, spectrum_cs_config_check, NULL);
+ if (ret) {
+ if (!ignore_cis_vcc)
+@@ -214,15 +319,23 @@ spectrum_cs_config(struct pcmcia_device *link)
goto failed;
}
@@ -908,7 +1368,7 @@
if (!mem)
goto failed;
-@@ -345,8 +384,16 @@ spectrum_cs_config(struct pcmcia_device
+@@ -244,8 +357,16 @@ spectrum_cs_config(struct pcmcia_device *link)
}
/* Register an interface with the stack */
@@ -925,9 +1385,25 @@
printk(KERN_ERR PFX "orinoco_if_add() failed\n");
goto failed;
}
+@@ -311,7 +432,13 @@ MODULE_DEVICE_TABLE(pcmcia, spectrum_cs_ids);
+
+ static struct pcmcia_driver orinoco_driver = {
+ .owner = THIS_MODULE,
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
+ .name = DRIVER_NAME,
++#else
++ .drv = {
++ .name = DRIVER_NAME,
++ },
++#endif
+ .probe = spectrum_cs_probe,
+ .remove = spectrum_cs_detach,
+ .suspend = spectrum_cs_suspend,
+diff --git a/drivers/ssb/main.c b/drivers/ssb/main.c
+index c68b3dc..ca29e40 100644
--- a/drivers/ssb/main.c
+++ b/drivers/ssb/main.c
-@@ -490,7 +490,11 @@ static int ssb_devices_register(struct s
+@@ -489,7 +489,11 @@ static int ssb_devices_register(struct ssb_bus *bus)
break;
case SSB_BUSTYPE_PCMCIA:
#ifdef CONFIG_SSB_PCMCIAHOST
--
1.7.0.4
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 3/4] compat-wirelsss: add carl9170
2010-09-19 17:46 [PATCH 1/4] compat-wireless: make patches apply again Hauke Mehrtens
2010-09-19 17:49 ` [PATCH 2/4] compat-wireless: "backport" pcmcia api changes Hauke Mehrtens
@ 2010-09-19 17:49 ` Hauke Mehrtens
2010-09-19 17:49 ` [PATCH 4/4] compat-wireless: fix unresolved symbols with old kernels Hauke Mehrtens
2 siblings, 0 replies; 9+ messages in thread
From: Hauke Mehrtens @ 2010-09-19 17:49 UTC (permalink / raw)
To: lrodriguez; +Cc: linux-wireless, mcgrof, Hauke Mehrtens, Christian Lamparter
This patch adds support for carl9170.
CC: Christian Lamparter <chunkeey@googlemail.com>
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
config.mk | 12 ++++++++++
patches/25-multicast-list_head.patch | 38 ++++++++++++++++++++++++++++++++++
scripts/admin-update.sh | 1 +
3 files changed, 51 insertions(+), 0 deletions(-)
diff --git a/config.mk b/config.mk
index a021172..7f73744 100644
--- a/config.mk
+++ b/config.mk
@@ -413,6 +413,18 @@ CONFIG_AR9170_USB=m
CONFIG_AR9170_LEDS=y
endif #CONFIG_COMPAT_KERNEL_28
+ifndef CONFIG_COMPAT_KERNEL_29
+CONFIG_CARL9170=m
+CONFIG_CARL9170_LEDS=y
+# CONFIG_CARL9170_DEBUGFS=y
+# CONFIG_CARL9170_WPC=y
+endif #CONFIG_COMPAT_KERNEL_29
+
+# This activates a threading fix for usb urb.
+# this is mainline commit: b3e670443b7fb8a2d29831b62b44a039c283e351
+# This fix will be included in some stable releases.
+CONFIG_COMPAT_USB_URB_THREAD_FIX=y
+
CONFIG_ATH9K_HTC=m
# CONFIG_ATH9K_HTC_DEBUGFS=y
diff --git a/patches/25-multicast-list_head.patch b/patches/25-multicast-list_head.patch
index 0f07b5c..5a6bb16 100644
--- a/patches/25-multicast-list_head.patch
+++ b/patches/25-multicast-list_head.patch
@@ -227,6 +227,44 @@ This also backport commit 2f787b0b76bf5de2eaa3ca3a29d89123ae03c856
}
return ((u64)(mfilt[1]) << 32) | mfilt[0];
+--- a/drivers/net/wireless/ath/carl9170/main.c
++++ b/drivers/net/wireless/ath/carl9170/main.c
+@@ -810,17 +810,35 @@ out:
+ return err;
+ }
+
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ static u64 carl9170_op_prepare_multicast(struct ieee80211_hw *hw,
+ struct netdev_hw_addr_list *mc_list)
++#else
++static u64 carl9170_op_prepare_multicast(struct ieee80211_hw *hw, int mc_count,
++ struct dev_addr_list *ha)
++#endif
+ {
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ struct netdev_hw_addr *ha;
++#else
++ int i;
++#endif
+ u64 mchash;
+
+ /* always get broadcast frames */
+ mchash = 1ULL << (0xff >> 2);
+
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
+ netdev_hw_addr_list_for_each(ha, mc_list)
+ mchash |= 1ULL << (ha->addr[5] >> 2);
++#else
++ for (i = 0; i < mc_count; i++) {
++ if (WARN_ON(!ha))
++ break;
++ mchash |= 1ULL << (ha->dmi_addr[5] >> 2);
++ ha = ha->next;
++ }
++#endif
+
+ return mchash;
+ }
--- a/drivers/net/wireless/libertas/main.c
+++ b/drivers/net/wireless/libertas/main.c
@@ -242,18 +242,34 @@ static int lbs_add_mcast_addrs(struct cm
diff --git a/scripts/admin-update.sh b/scripts/admin-update.sh
index 6ef281d..ac9470d 100755
--- a/scripts/admin-update.sh
+++ b/scripts/admin-update.sh
@@ -192,6 +192,7 @@ fi
# Drivers that have their own directory
DRIVERS="drivers/net/wireless/ath"
+DRIVERS="$DRIVERS drivers/net/wireless/ath/carl9170"
DRIVERS="$DRIVERS drivers/net/wireless/ath/ar9170"
DRIVERS="$DRIVERS drivers/net/wireless/ath/ath5k"
DRIVERS="$DRIVERS drivers/net/wireless/ath/ath9k"
--
1.7.0.4
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 4/4] compat-wireless: fix unresolved symbols with old kernels
2010-09-19 17:46 [PATCH 1/4] compat-wireless: make patches apply again Hauke Mehrtens
2010-09-19 17:49 ` [PATCH 2/4] compat-wireless: "backport" pcmcia api changes Hauke Mehrtens
2010-09-19 17:49 ` [PATCH 3/4] compat-wirelsss: add carl9170 Hauke Mehrtens
@ 2010-09-19 17:49 ` Hauke Mehrtens
2 siblings, 0 replies; 9+ messages in thread
From: Hauke Mehrtens @ 2010-09-19 17:49 UTC (permalink / raw)
To: lrodriguez; +Cc: linux-wireless, mcgrof, Hauke Mehrtens
CONFIG_WEXT_PRIV and CONFIG_WEXT_SPY were introduced with kernel 2.6.33
and are not available in older kernel versions. We should just depend on
them for recent kernel versions, but this feature is not implemented in
compat-wireless yet. If compat-wireless was commpield against kernel <
2.6.29 with e.g. CONFIG_IPW2200=m then libipw was not build in compat-
wireless but ipw2200 was build, because the config options set in the
kernel config were used. For now we build ipw2*00 every time
CONFIG_WIRELESS_EXT is enabled. This could cause some problems with
kernel > 2.6.32 and CONFIG_WEXT_PRIV=n but there are no such
distribution kernel available and we haven't got an bug report because
of this problem although is problem existed for a long time.
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
config.mk | 8 --------
1 files changed, 0 insertions(+), 8 deletions(-)
diff --git a/config.mk b/config.mk
index 7f73744..de5766f 100644
--- a/config.mk
+++ b/config.mk
@@ -249,8 +249,6 @@ CONFIG_B43LEGACY_DMA=y
CONFIG_B43LEGACY_PIO=y
ifdef CONFIG_WIRELESS_EXT
-ifdef CONFIG_WEXT_SPY
-ifdef CONFIG_WEXT_PRIV
# The Intel ipws
CONFIG_LIBIPW=m
# CONFIG_LIBIPW_DEBUG=y
@@ -276,8 +274,6 @@ CONFIG_IPW2200_QOS=y
# it on via sysfs:
#
# % echo 1 > /sys/bus/pci/drivers/ipw2200/*/rtap_iface
-endif #CONFIG_WEXT_PRIV
-endif #CONFIG_WEXT_SPY
endif #CONFIG_WIRELESS_EXT
ifdef CONFIG_SSB
@@ -337,8 +333,6 @@ CONFIG_ATL1C=m
endif #CONFIG_COMPAT_KERNEL_27
ifdef CONFIG_WIRELESS_EXT
-ifdef CONFIG_WEXT_SPY
-ifdef CONFIG_WEXT_PRIV
CONFIG_HERMES=m
CONFIG_HERMES_CACHE_FW_ON_INIT=y
ifdef CONFIG_PPC_PMAC
@@ -352,8 +346,6 @@ ifdef CONFIG_PCMCIA
CONFIG_PCMCIA_HERMES=m
CONFIG_PCMCIA_SPECTRUM=m
endif #CONFIG_PCMCIA
-endif #CONFIG_WEXT_PRIV
-endif #CONFIG_WEXT_SPY
endif #CONFIG_WIRELESS_EXT
endif #CONFIG_PCI
--
1.7.0.4
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH 2/2 v2] compat-wireless: "backport" pcmcia api changes.
2010-09-19 17:49 ` [PATCH 2/4] compat-wireless: "backport" pcmcia api changes Hauke Mehrtens
@ 2010-09-19 17:56 ` Hauke Mehrtens
2010-09-20 15:26 ` Luis R. Rodriguez
0 siblings, 1 reply; 9+ messages in thread
From: Hauke Mehrtens @ 2010-09-19 17:56 UTC (permalink / raw)
To: lrodriguez; +Cc: linux-wireless, mcgrof, Hauke Mehrtens
The PCMCIA API changed again.
This patch was only compile tested, beacuse I do not have devices to
test this.
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
---
patches/24-pcmcia.patch | 836 ++++++++++++++++++++++++++++++++++++-----------
1 files changed, 647 insertions(+), 189 deletions(-)
diff --git a/patches/24-pcmcia.patch b/patches/24-pcmcia.patch
index 6324a76..4e1aedb 100644
--- a/patches/24-pcmcia.patch
+++ b/patches/24-pcmcia.patch
@@ -1,6 +1,6 @@
--- a/drivers/bluetooth/bluecard_cs.c
+++ b/drivers/bluetooth/bluecard_cs.c
-@@ -159,7 +159,12 @@ static void bluecard_detach(struct pcmci
+@@ -158,7 +158,12 @@ static void bluecard_detach(struct pcmci
static void bluecard_activity_led_timeout(u_long arg)
{
bluecard_info_t *info = (bluecard_info_t *)arg;
@@ -13,7 +13,7 @@
if (!test_bit(CARD_HAS_PCCARD_ID, &(info->hw_state)))
return;
-@@ -176,7 +181,11 @@ static void bluecard_activity_led_timeou
+@@ -175,7 +180,11 @@ static void bluecard_activity_led_timeou
static void bluecard_enable_activity_led(bluecard_info_t *info)
{
@@ -25,7 +25,7 @@
if (!test_bit(CARD_HAS_PCCARD_ID, &(info->hw_state)))
return;
-@@ -232,7 +241,11 @@ static void bluecard_write_wakeup(blueca
+@@ -231,7 +240,11 @@ static void bluecard_write_wakeup(blueca
}
do {
@@ -37,7 +37,7 @@
register unsigned int offset;
register unsigned char command;
register unsigned long ready_bit;
-@@ -379,7 +392,11 @@ static void bluecard_receive(bluecard_in
+@@ -378,7 +391,11 @@ static void bluecard_receive(bluecard_in
return;
}
@@ -49,7 +49,7 @@
if (test_bit(XMIT_SENDING_READY, &(info->tx_state)))
bluecard_enable_activity_led(info);
-@@ -508,7 +525,11 @@ static irqreturn_t bluecard_interrupt(in
+@@ -507,7 +524,11 @@ static irqreturn_t bluecard_interrupt(in
if (!test_bit(CARD_READY, &(info->hw_state)))
return IRQ_HANDLED;
@@ -61,7 +61,7 @@
spin_lock(&(info->lock));
-@@ -622,7 +643,11 @@ static int bluecard_hci_flush(struct hci
+@@ -621,7 +642,11 @@ static int bluecard_hci_flush(struct hci
static int bluecard_hci_open(struct hci_dev *hdev)
{
bluecard_info_t *info = (bluecard_info_t *)(hdev->driver_data);
@@ -73,7 +73,7 @@
if (test_bit(CARD_HAS_PCCARD_ID, &(info->hw_state)))
bluecard_hci_set_baud_rate(hdev, DEFAULT_BAUD_RATE);
-@@ -642,7 +667,11 @@ static int bluecard_hci_open(struct hci_
+@@ -641,7 +666,11 @@ static int bluecard_hci_open(struct hci_
static int bluecard_hci_close(struct hci_dev *hdev)
{
bluecard_info_t *info = (bluecard_info_t *)(hdev->driver_data);
@@ -85,7 +85,7 @@
if (!test_and_clear_bit(HCI_RUNNING, &(hdev->flags)))
return 0;
-@@ -709,7 +738,11 @@ static int bluecard_hci_ioctl(struct hci
+@@ -708,7 +737,11 @@ static int bluecard_hci_ioctl(struct hci
static int bluecard_open(bluecard_info_t *info)
{
@@ -97,7 +97,7 @@
struct hci_dev *hdev;
unsigned char id;
-@@ -828,7 +861,11 @@ static int bluecard_open(bluecard_info_t
+@@ -827,7 +860,11 @@ static int bluecard_open(bluecard_info_t
static int bluecard_close(bluecard_info_t *info)
{
@@ -109,7 +109,7 @@
struct hci_dev *hdev = info->hdev;
if (!hdev)
-@@ -865,6 +902,12 @@ static int bluecard_probe(struct pcmcia_
+@@ -864,7 +901,18 @@ static int bluecard_probe(struct pcmcia_
info->p_dev = link;
link->priv = info;
@@ -119,12 +119,24 @@
+ link->irq.Handler = bluecard_interrupt;
+#endif
+
- link->conf.Attributes = CONF_ENABLE_IRQ;
- link->conf.IntType = INT_MEMORY_AND_IO;
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
+ link->config_flags |= CONF_ENABLE_IRQ;
++#else
++ link->conf.Attributes = CONF_ENABLE_IRQ;
++ link->conf.IntType = INT_MEMORY_AND_IO;
++#endif
-@@ -888,13 +931,24 @@ static int bluecard_config(struct pcmcia
+ return bluecard_config(link);
+ }
+@@ -884,15 +932,30 @@ static int bluecard_config(struct pcmcia
+ bluecard_info_t *info = link->priv;
+ int i, n;
- link->conf.ConfigIndex = 0x20;
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
+ link->config_index = 0x20;
++#else
++ link->conf.ConfigIndex = 0x20;
++#endif
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36))
link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
@@ -147,7 +159,7 @@
if (i == 0)
break;
}
-@@ -902,9 +956,15 @@ static int bluecard_config(struct pcmcia
+@@ -900,9 +963,15 @@ static int bluecard_config(struct pcmcia
if (i != 0)
goto failed;
@@ -161,11 +173,25 @@
+ link->irq.AssignedIRQ = 0;
+#endif
- i = pcmcia_request_configuration(link, &link->conf);
+ i = pcmcia_enable_device(link);
if (i != 0)
+@@ -940,7 +1009,13 @@ MODULE_DEVICE_TABLE(pcmcia, bluecard_ids
+
+ static struct pcmcia_driver bluecard_driver = {
+ .owner = THIS_MODULE,
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
+ .name = "bluecard_cs",
++#else
++ .drv = {
++ .name = "bluecard_cs",
++ },
++#endif
+ .probe = bluecard_probe,
+ .remove = bluecard_detach,
+ .id_table = bluecard_ids,
--- a/drivers/bluetooth/bt3c_cs.c
+++ b/drivers/bluetooth/bt3c_cs.c
-@@ -188,7 +188,11 @@ static void bt3c_write_wakeup(bt3c_info_
+@@ -187,7 +187,11 @@ static void bt3c_write_wakeup(bt3c_info_
return;
do {
@@ -177,7 +203,7 @@
register struct sk_buff *skb;
register int len;
-@@ -226,7 +230,11 @@ static void bt3c_receive(bt3c_info_t *in
+@@ -225,7 +229,11 @@ static void bt3c_receive(bt3c_info_t *in
return;
}
@@ -189,7 +215,7 @@
avail = bt3c_read(iobase, 0x7006);
//printk("bt3c_cs: receiving %d bytes\n", avail);
-@@ -347,7 +355,11 @@ static irqreturn_t bt3c_interrupt(int ir
+@@ -346,7 +354,11 @@ static irqreturn_t bt3c_interrupt(int ir
/* our irq handler is shared */
return IRQ_NONE;
@@ -201,7 +227,7 @@
spin_lock(&(info->lock));
-@@ -480,7 +492,11 @@ static int bt3c_load_firmware(bt3c_info_
+@@ -479,7 +491,11 @@ static int bt3c_load_firmware(bt3c_info_
unsigned int iobase, size, addr, fcs, tmp;
int i, err = 0;
@@ -213,13 +239,17 @@
/* Reset */
bt3c_io_write(iobase, 0x8040, 0x0404);
-@@ -657,8 +673,19 @@ static int bt3c_probe(struct pcmcia_devi
+@@ -656,8 +672,27 @@ static int bt3c_probe(struct pcmcia_devi
info->p_dev = link;
link->priv = info;
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
+ link->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_SET_VPP |
+ CONF_AUTO_SET_IO;
++#else
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36))
- link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
- link->resource[0]->end = 8;
++ link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
++ link->resource[0]->end = 8;
+#else
+ link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
+ link->io.NumPorts1= 8;
@@ -230,50 +260,86 @@
+
+ link->irq.Handler = bt3c_interrupt;
+#endif
++
++ link->conf.Attributes = CONF_ENABLE_IRQ;
++ link->conf.IntType = INT_MEMORY_AND_IO;
++#endif
- link->conf.Attributes = CONF_ENABLE_IRQ;
- link->conf.IntType = INT_MEMORY_AND_IO;
-@@ -683,14 +710,23 @@ static int bt3c_check_config(struct pcmc
- {
- unsigned long try = (unsigned long) priv_data;
+ return bt3c_config(link);
+ }
+@@ -671,6 +706,7 @@ static void bt3c_detach(struct pcmcia_de
+ kfree(info);
+ }
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
+ static int bt3c_check_config(struct pcmcia_device *p_dev, void *priv_data)
+ {
+ int *try = priv_data;
+@@ -709,6 +745,63 @@ static int bt3c_check_config_notpicky(st
+ }
+ return -ENODEV;
+ }
++#else
++static int bt3c_check_config(struct pcmcia_device *p_dev,
++ cistpl_cftable_entry_t *cf,
++ cistpl_cftable_entry_t *dflt,
++ unsigned int vcc,
++ void *priv_data)
++{
++ unsigned long try = (unsigned long) priv_data;
++
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36))
- p_dev->io_lines = (try == 0) ? 16 : cf->io.flags & CISTPL_IO_LINES_MASK;
++ p_dev->io_lines = (try == 0) ? 16 : cf->io.flags & CISTPL_IO_LINES_MASK;
+#endif
-
- if (cf->vpp1.present & (1 << CISTPL_POWER_VNOM))
- p_dev->conf.Vpp = cf->vpp1.param[CISTPL_POWER_VNOM] / 10000;
- if ((cf->io.nwin > 0) && (cf->io.win[0].len == 8) &&
- (cf->io.win[0].base != 0)) {
++
++ if (cf->vpp1.present & (1 << CISTPL_POWER_VNOM))
++ p_dev->conf.Vpp = cf->vpp1.param[CISTPL_POWER_VNOM] / 10000;
++ if ((cf->io.nwin > 0) && (cf->io.win[0].len == 8) &&
++ (cf->io.win[0].base != 0)) {
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36))
- p_dev->resource[0]->start = cf->io.win[0].base;
- if (!pcmcia_request_io(p_dev))
++ p_dev->resource[0]->start = cf->io.win[0].base;
++ if (!pcmcia_request_io(p_dev))
+#else
+ p_dev->io.BasePort1 = cf->io.win[0].base;
+ p_dev->io.IOAddrLines = (try == 0) ? 16 :
+ cf->io.flags & CISTPL_IO_LINES_MASK;
+ if (!pcmcia_request_io(p_dev, &p_dev->io))
+#endif
- return 0;
- }
- return -ENODEV;
-@@ -707,9 +743,15 @@ static int bt3c_check_config_notpicky(st
-
- if ((cf->io.nwin > 0) && ((cf->io.flags & CISTPL_IO_LINES_MASK) <= 3)) {
- for (j = 0; j < 5; j++) {
++ return 0;
++ }
++ return -ENODEV;
++}
++
++static int bt3c_check_config_notpicky(struct pcmcia_device *p_dev,
++ cistpl_cftable_entry_t *cf,
++ cistpl_cftable_entry_t *dflt,
++ unsigned int vcc,
++ void *priv_data)
++{
++ static unsigned int base[5] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8, 0x0 };
++ int j;
++
++ if ((cf->io.nwin > 0) && ((cf->io.flags & CISTPL_IO_LINES_MASK) <= 3)) {
++ for (j = 0; j < 5; j++) {
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36))
- p_dev->resource[0]->start = base[j];
- p_dev->io_lines = base[j] ? 16 : 3;
- if (!pcmcia_request_io(p_dev))
++ p_dev->resource[0]->start = base[j];
++ p_dev->io_lines = base[j] ? 16 : 3;
++ if (!pcmcia_request_io(p_dev))
+#else
+ p_dev->io.BasePort1 = base[j];
+ p_dev->io.IOAddrLines = base[j] ? 16 : 3;
+ if (!pcmcia_request_io(p_dev, &p_dev->io))
+#endif
- return 0;
- }
- }
-@@ -738,9 +780,15 @@ static int bt3c_config(struct pcmcia_dev
++ return 0;
++ }
++ }
++ return -ENODEV;
++}
++#endif
+
+ static int bt3c_config(struct pcmcia_device *link)
+ {
+@@ -732,9 +825,15 @@ static int bt3c_config(struct pcmcia_dev
goto failed;
found_port:
@@ -287,11 +353,25 @@
+ link->irq.AssignedIRQ = 0;
+#endif
- i = pcmcia_request_configuration(link, &link->conf);
+ i = pcmcia_enable_device(link);
if (i != 0)
+@@ -769,7 +868,13 @@ MODULE_DEVICE_TABLE(pcmcia, bt3c_ids);
+
+ static struct pcmcia_driver bt3c_driver = {
+ .owner = THIS_MODULE,
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
+ .name = "bt3c_cs",
++#else
++ .drv = {
++ .name = "bt3c_cs",
++ },
++#endif
+ .probe = bt3c_probe,
+ .remove = bt3c_detach,
+ .id_table = bt3c_ids,
--- a/drivers/bluetooth/btuart_cs.c
+++ b/drivers/bluetooth/btuart_cs.c
-@@ -142,7 +142,11 @@ static void btuart_write_wakeup(btuart_i
+@@ -141,7 +141,11 @@ static void btuart_write_wakeup(btuart_i
}
do {
@@ -303,7 +383,7 @@
register struct sk_buff *skb;
register int len;
-@@ -183,7 +187,11 @@ static void btuart_receive(btuart_info_t
+@@ -182,7 +186,11 @@ static void btuart_receive(btuart_info_t
return;
}
@@ -315,7 +395,7 @@
do {
info->hdev->stat.byte_rx++;
-@@ -297,7 +305,11 @@ static irqreturn_t btuart_interrupt(int
+@@ -296,7 +304,11 @@ static irqreturn_t btuart_interrupt(int
/* our irq handler is shared */
return IRQ_NONE;
@@ -327,7 +407,7 @@
spin_lock(&(info->lock));
-@@ -354,7 +366,11 @@ static void btuart_change_speed(btuart_i
+@@ -353,7 +365,11 @@ static void btuart_change_speed(btuart_i
return;
}
@@ -339,7 +419,7 @@
spin_lock_irqsave(&(info->lock), flags);
-@@ -478,7 +494,11 @@ static int btuart_hci_ioctl(struct hci_d
+@@ -477,7 +493,11 @@ static int btuart_hci_ioctl(struct hci_d
static int btuart_open(btuart_info_t *info)
{
unsigned long flags;
@@ -351,7 +431,7 @@
struct hci_dev *hdev;
spin_lock_init(&(info->lock));
-@@ -548,7 +568,11 @@ static int btuart_open(btuart_info_t *in
+@@ -547,7 +567,11 @@ static int btuart_open(btuart_info_t *in
static int btuart_close(btuart_info_t *info)
{
unsigned long flags;
@@ -363,13 +443,17 @@
struct hci_dev *hdev = info->hdev;
if (!hdev)
-@@ -586,8 +610,19 @@ static int btuart_probe(struct pcmcia_de
+@@ -585,8 +609,27 @@ static int btuart_probe(struct pcmcia_de
info->p_dev = link;
link->priv = info;
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
+ link->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_SET_VPP |
+ CONF_AUTO_SET_IO;
++#else
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36))
- link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
- link->resource[0]->end = 8;
++ link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
++ link->resource[0]->end = 8;
+#else
+ link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
+ link->io.NumPorts1= 8;
@@ -380,50 +464,86 @@
+
+ link->irq.Handler = btuart_interrupt;
+#endif
++
++ link->conf.Attributes = CONF_ENABLE_IRQ;
++ link->conf.IntType = INT_MEMORY_AND_IO;
++#endif
+
+ return btuart_config(link);
+ }
+@@ -600,6 +643,7 @@ static void btuart_detach(struct pcmcia_
+ kfree(info);
+ }
- link->conf.Attributes = CONF_ENABLE_IRQ;
- link->conf.IntType = INT_MEMORY_AND_IO;
-@@ -612,14 +647,23 @@ static int btuart_check_config(struct pc
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
+ static int btuart_check_config(struct pcmcia_device *p_dev, void *priv_data)
{
int *try = priv_data;
-
+@@ -638,6 +682,63 @@ static int btuart_check_config_notpicky(
+ }
+ return -ENODEV;
+ }
++#else
++static int btuart_check_config(struct pcmcia_device *p_dev,
++ cistpl_cftable_entry_t *cf,
++ cistpl_cftable_entry_t *dflt,
++ unsigned int vcc,
++ void *priv_data)
++{
++ int *try = priv_data;
++
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36))
- p_dev->io_lines = (try == 0) ? 16 : cf->io.flags & CISTPL_IO_LINES_MASK;
++ p_dev->io_lines = (try == 0) ? 16 : cf->io.flags & CISTPL_IO_LINES_MASK;
+#endif
-
- if (cf->vpp1.present & (1 << CISTPL_POWER_VNOM))
- p_dev->conf.Vpp = cf->vpp1.param[CISTPL_POWER_VNOM] / 10000;
- if ((cf->io.nwin > 0) && (cf->io.win[0].len == 8) &&
- (cf->io.win[0].base != 0)) {
++
++ if (cf->vpp1.present & (1 << CISTPL_POWER_VNOM))
++ p_dev->conf.Vpp = cf->vpp1.param[CISTPL_POWER_VNOM] / 10000;
++ if ((cf->io.nwin > 0) && (cf->io.win[0].len == 8) &&
++ (cf->io.win[0].base != 0)) {
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36))
- p_dev->resource[0]->start = cf->io.win[0].base;
- if (!pcmcia_request_io(p_dev))
++ p_dev->resource[0]->start = cf->io.win[0].base;
++ if (!pcmcia_request_io(p_dev))
+#else
+ p_dev->io.BasePort1 = cf->io.win[0].base;
+ p_dev->io.IOAddrLines = (*try == 0) ? 16 :
+ cf->io.flags & CISTPL_IO_LINES_MASK;
+ if (!pcmcia_request_io(p_dev, &p_dev->io))
+#endif
- return 0;
- }
- return -ENODEV;
-@@ -636,9 +680,15 @@ static int btuart_check_config_notpicky(
-
- if ((cf->io.nwin > 0) && ((cf->io.flags & CISTPL_IO_LINES_MASK) <= 3)) {
- for (j = 0; j < 5; j++) {
++ return 0;
++ }
++ return -ENODEV;
++}
++
++static int btuart_check_config_notpicky(struct pcmcia_device *p_dev,
++ cistpl_cftable_entry_t *cf,
++ cistpl_cftable_entry_t *dflt,
++ unsigned int vcc,
++ void *priv_data)
++{
++ static unsigned int base[5] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8, 0x0 };
++ int j;
++
++ if ((cf->io.nwin > 0) && ((cf->io.flags & CISTPL_IO_LINES_MASK) <= 3)) {
++ for (j = 0; j < 5; j++) {
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36))
- p_dev->resource[0]->start = base[j];
- p_dev->io_lines = base[j] ? 16 : 3;
- if (!pcmcia_request_io(p_dev))
++ p_dev->resource[0]->start = base[j];
++ p_dev->io_lines = base[j] ? 16 : 3;
++ if (!pcmcia_request_io(p_dev))
+#else
+ p_dev->io.BasePort1 = base[j];
+ p_dev->io.IOAddrLines = base[j] ? 16 : 3;
+ if (!pcmcia_request_io(p_dev, &p_dev->io))
+#endif
- return 0;
- }
- }
-@@ -667,9 +717,15 @@ static int btuart_config(struct pcmcia_d
++ return 0;
++ }
++ }
++ return -ENODEV;
++}
++#endif
+
+ static int btuart_config(struct pcmcia_device *link)
+ {
+@@ -661,9 +762,15 @@ static int btuart_config(struct pcmcia_d
goto failed;
found_port:
@@ -437,11 +557,25 @@
+ link->irq.AssignedIRQ = 0;
+#endif
- i = pcmcia_request_configuration(link, &link->conf);
+ i = pcmcia_enable_device(link);
if (i != 0)
+@@ -697,7 +804,13 @@ MODULE_DEVICE_TABLE(pcmcia, btuart_ids);
+
+ static struct pcmcia_driver btuart_driver = {
+ .owner = THIS_MODULE,
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
+ .name = "btuart_cs",
++#else
++ .drv = {
++ .name = "btuart_cs",
++ },
++#endif
+ .probe = btuart_probe,
+ .remove = btuart_detach,
+ .id_table = btuart_ids,
--- a/drivers/bluetooth/dtl1_cs.c
+++ b/drivers/bluetooth/dtl1_cs.c
-@@ -149,7 +149,11 @@ static void dtl1_write_wakeup(dtl1_info_
+@@ -148,7 +148,11 @@ static void dtl1_write_wakeup(dtl1_info_
}
do {
@@ -453,7 +587,7 @@
register struct sk_buff *skb;
register int len;
-@@ -214,7 +218,11 @@ static void dtl1_receive(dtl1_info_t *in
+@@ -213,7 +217,11 @@ static void dtl1_receive(dtl1_info_t *in
return;
}
@@ -465,7 +599,7 @@
do {
info->hdev->stat.byte_rx++;
-@@ -301,7 +309,11 @@ static irqreturn_t dtl1_interrupt(int ir
+@@ -300,7 +308,11 @@ static irqreturn_t dtl1_interrupt(int ir
/* our irq handler is shared */
return IRQ_NONE;
@@ -477,7 +611,7 @@
spin_lock(&(info->lock));
-@@ -461,7 +473,11 @@ static int dtl1_hci_ioctl(struct hci_dev
+@@ -460,7 +472,11 @@ static int dtl1_hci_ioctl(struct hci_dev
static int dtl1_open(dtl1_info_t *info)
{
unsigned long flags;
@@ -489,7 +623,7 @@
struct hci_dev *hdev;
spin_lock_init(&(info->lock));
-@@ -508,8 +524,13 @@ static int dtl1_open(dtl1_info_t *info)
+@@ -507,8 +523,13 @@ static int dtl1_open(dtl1_info_t *info)
outb(UART_LCR_WLEN8, iobase + UART_LCR); /* Reset DLAB */
outb((UART_MCR_DTR | UART_MCR_RTS | UART_MCR_OUT2), iobase + UART_MCR);
@@ -503,7 +637,7 @@
/* Turn on interrupts */
outb(UART_IER_RLSI | UART_IER_RDI | UART_IER_THRI, iobase + UART_IER);
-@@ -534,7 +555,11 @@ static int dtl1_open(dtl1_info_t *info)
+@@ -533,7 +554,11 @@ static int dtl1_open(dtl1_info_t *info)
static int dtl1_close(dtl1_info_t *info)
{
unsigned long flags;
@@ -515,13 +649,16 @@
struct hci_dev *hdev = info->hdev;
if (!hdev)
-@@ -572,8 +597,17 @@ static int dtl1_probe(struct pcmcia_devi
+@@ -571,7 +596,24 @@ static int dtl1_probe(struct pcmcia_devi
info->p_dev = link;
link->priv = info;
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
+ link->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_SET_IO;
++#else
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36))
- link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
- link->resource[0]->end = 8;
++ link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
++ link->resource[0]->end = 8;
+#else
+ link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
+ link->io.NumPorts1= 8;
@@ -530,28 +667,52 @@
+ link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
+ link->irq.Handler = dtl1_interrupt;
+#endif
++
++ link->conf.Attributes = CONF_ENABLE_IRQ;
++ link->conf.IntType = INT_MEMORY_AND_IO;
++#endif
- link->conf.Attributes = CONF_ENABLE_IRQ;
- link->conf.IntType = INT_MEMORY_AND_IO;
-@@ -600,10 +634,17 @@ static int dtl1_confcheck(struct pcmcia_
- if ((cf->io.nwin != 1) || (cf->io.win[0].len <= 8))
- return -ENODEV;
+ return dtl1_config(link);
+ }
+@@ -586,6 +628,7 @@ static void dtl1_detach(struct pcmcia_de
+ kfree(info);
+ }
+
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
+ static int dtl1_confcheck(struct pcmcia_device *p_dev, void *priv_data)
+ {
+ if ((p_dev->resource[1]->end) || (p_dev->resource[1]->end < 8))
+@@ -596,6 +639,29 @@ static int dtl1_confcheck(struct pcmcia_
-+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36))
- p_dev->resource[0]->start = cf->io.win[0].base;
- p_dev->resource[0]->end = cf->io.win[0].len; /*yo */
- p_dev->io_lines = cf->io.flags & CISTPL_IO_LINES_MASK;
return pcmcia_request_io(p_dev);
+ }
++#else
++static int dtl1_confcheck(struct pcmcia_device *p_dev,
++ cistpl_cftable_entry_t *cf,
++ cistpl_cftable_entry_t *dflt,
++ unsigned int vcc,
++ void *priv_data)
++{
++ if ((cf->io.nwin != 1) || (cf->io.win[0].len <= 8))
++ return -ENODEV;
++
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36))
++ p_dev->resource[0]->start = cf->io.win[0].base;
++ p_dev->resource[0]->end = cf->io.win[0].len; /*yo */
++ p_dev->io_lines = cf->io.flags & CISTPL_IO_LINES_MASK;
++ return pcmcia_request_io(p_dev);
+#else
+ p_dev->io.BasePort1 = cf->io.win[0].base;
+ p_dev->io.NumPorts1 = cf->io.win[0].len; /*yo */
+ p_dev->io.IOAddrLines = cf->io.flags & CISTPL_IO_LINES_MASK;
+ return pcmcia_request_io(p_dev, &p_dev->io);
+#endif
- }
++}
++#endif
static int dtl1_config(struct pcmcia_device *link)
-@@ -612,13 +653,23 @@ static int dtl1_config(struct pcmcia_dev
+ {
+@@ -603,13 +669,23 @@ static int dtl1_config(struct pcmcia_dev
int i;
/* Look for a generic full-sized window */
@@ -573,11 +734,65 @@
+ link->irq.AssignedIRQ = 0;
+#endif
- i = pcmcia_request_configuration(link, &link->conf);
+ i = pcmcia_enable_device(link);
if (i != 0)
+@@ -647,7 +723,13 @@ MODULE_DEVICE_TABLE(pcmcia, dtl1_ids);
+
+ static struct pcmcia_driver dtl1_driver = {
+ .owner = THIS_MODULE,
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
+ .name = "dtl1_cs",
++#else
++ .drv = {
++ .name = "dtl1_cs",
++ },
++#endif
+ .probe = dtl1_probe,
+ .remove = dtl1_detach,
+ .id_table = dtl1_ids,
--- a/drivers/net/wireless/b43/pcmcia.c
+++ b/drivers/net/wireless/b43/pcmcia.c
-@@ -89,7 +89,14 @@ static int __devinit b43_pcmcia_probe(st
+@@ -62,6 +62,9 @@ static int b43_pcmcia_resume(struct pcmc
+ static int __devinit b43_pcmcia_probe(struct pcmcia_device *dev)
+ {
+ struct ssb_bus *ssb;
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37))
++ win_req_t win;
++#endif
+ int err = -ENOMEM;
+ int res = 0;
+
+@@ -71,6 +74,7 @@ static int __devinit b43_pcmcia_probe(st
+
+ err = -ENODEV;
+
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
+ dev->config_flags |= CONF_ENABLE_IRQ;
+
+ dev->resource[2]->flags |= WIN_ENABLE | WIN_DATA_WIDTH_16 |
+@@ -78,21 +82,46 @@ static int __devinit b43_pcmcia_probe(st
+ dev->resource[2]->start = 0;
+ dev->resource[2]->end = SSB_CORE_SIZE;
+ res = pcmcia_request_window(dev, dev->resource[2], 250);
++#else
++ dev->conf.Attributes = CONF_ENABLE_IRQ;
++ dev->conf.IntType = INT_MEMORY_AND_IO;
++
++ win.Attributes = WIN_ENABLE | WIN_DATA_WIDTH_16 |
++ WIN_USE_WAIT;
++ win.Base = 0;
++ win.Size = SSB_CORE_SIZE;
++ win.AccessSpeed = 250;
++ res = pcmcia_request_window(dev, &win, &dev->win);
++#endif
+ if (res != 0)
+ goto err_kfree_ssb;
+-
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
+ res = pcmcia_map_mem_page(dev, dev->resource[2], 0);
++#else
++ res = pcmcia_map_mem_page(dev, dev->win, 0);
++#endif
if (res != 0)
goto err_disable;
@@ -591,10 +806,35 @@
+#endif
goto err_disable;
- res = pcmcia_request_configuration(dev, &dev->conf);
+ res = pcmcia_enable_device(dev);
+ if (res != 0)
+ goto err_disable;
+
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
+ err = ssb_bus_pcmciabus_register(ssb, dev, dev->resource[2]->start);
++#else
++ err = ssb_bus_pcmciabus_register(ssb, dev, win.Base);
++#endif
+ if (err)
+ goto err_disable;
+ dev->priv = ssb;
+@@ -121,7 +150,13 @@ static void __devexit b43_pcmcia_remove(
+
+ static struct pcmcia_driver b43_pcmcia_driver = {
+ .owner = THIS_MODULE,
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
+ .name = "b43-pcmcia",
++#else
++ .drv = {
++ .name = "b43-pcmcia",
++ },
++#endif
+ .id_table = b43_pcmcia_tbl,
+ .probe = b43_pcmcia_probe,
+ .remove = __devexit_p(b43_pcmcia_remove),
--- a/drivers/net/wireless/libertas/if_cs.c
+++ b/drivers/net/wireless/libertas/if_cs.c
-@@ -774,7 +774,11 @@ static void if_cs_release(struct pcmcia_
+@@ -764,7 +764,11 @@ static void if_cs_release(struct pcmcia_
lbs_deb_enter(LBS_DEB_CS);
@@ -606,24 +846,45 @@
pcmcia_disable_device(p_dev);
if (card->iobase)
ioport_unmap(card->iobase);
-@@ -799,9 +803,15 @@ static int if_cs_ioprobe(struct pcmcia_d
- unsigned int vcc,
- void *priv_data)
+@@ -772,7 +776,7 @@ static void if_cs_release(struct pcmcia_
+ lbs_deb_leave(LBS_DEB_CS);
+ }
+
+-
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
+ static int if_cs_ioprobe(struct pcmcia_device *p_dev, void *priv_data)
{
+ p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH;
+@@ -782,9 +786,39 @@ static int if_cs_ioprobe(struct pcmcia_d
+ lbs_pr_err("wrong CIS (check number of IO windows)\n");
+ return -ENODEV;
+ }
++#else
++static int if_cs_ioprobe(struct pcmcia_device *p_dev,
++ cistpl_cftable_entry_t *cfg,
++ cistpl_cftable_entry_t *dflt,
++ unsigned int vcc,
++ void *priv_data)
++{
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36))
- p_dev->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
- p_dev->resource[0]->start = cfg->io.win[0].base;
- p_dev->resource[0]->end = cfg->io.win[0].len;
++ p_dev->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
++ p_dev->resource[0]->start = cfg->io.win[0].base;
++ p_dev->resource[0]->end = cfg->io.win[0].len;
+#else
+ p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
+ p_dev->io.BasePort1 = cfg->io.win[0].base;
+ p_dev->io.NumPorts1 = cfg->io.win[0].len;
+#endif
-
- /* Do we need to allocate an interrupt? */
- p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
-@@ -813,7 +823,11 @@ static int if_cs_ioprobe(struct pcmcia_d
- }
++
++ /* Do we need to allocate an interrupt? */
++ p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
++
++ /* IO window settings */
++ if (cfg->io.nwin != 1) {
++ lbs_pr_err("wrong CIS (check number of IO windows)\n");
++ return -ENODEV;
++ }
++#endif
/* This reserves IO space but doesn't actually enable it */
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36))
@@ -634,19 +895,24 @@
}
static int if_cs_probe(struct pcmcia_device *p_dev)
-@@ -835,6 +849,11 @@ static int if_cs_probe(struct pcmcia_dev
+@@ -806,7 +840,16 @@ static int if_cs_probe(struct pcmcia_dev
card->p_dev = p_dev;
p_dev->priv = card;
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
+ p_dev->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_SET_IO;
++#else
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35))
+ p_dev->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
+ p_dev->irq.Handler = NULL;
+#endif
-+
- p_dev->conf.Attributes = 0;
- p_dev->conf.IntType = INT_MEMORY_AND_IO;
++ p_dev->conf.Attributes = 0;
++ p_dev->conf.IntType = INT_MEMORY_AND_IO;
++#endif
-@@ -848,12 +867,26 @@ static int if_cs_probe(struct pcmcia_dev
+ if (pcmcia_loop_config(p_dev, if_cs_ioprobe, NULL)) {
+ lbs_pr_err("error in pcmcia_loop_config\n");
+@@ -818,12 +861,26 @@ static int if_cs_probe(struct pcmcia_dev
* a handler to the interrupt, unless the 'Handler' member of
* the irq structure is initialized.
*/
@@ -673,7 +939,7 @@
if (!card->iobase) {
lbs_pr_err("error in ioport_map\n");
ret = -EIO;
-@@ -872,7 +905,17 @@ static int if_cs_probe(struct pcmcia_dev
+@@ -837,7 +894,17 @@ static int if_cs_probe(struct pcmcia_dev
}
/* Finally, report what we've done */
@@ -691,7 +957,7 @@
/*
* Most of the libertas cards can do unaligned register access, but some
-@@ -941,7 +984,11 @@ static int if_cs_probe(struct pcmcia_dev
+@@ -906,7 +973,11 @@ static int if_cs_probe(struct pcmcia_dev
priv->fw_ready = 1;
/* Now actually get the IRQ */
@@ -703,9 +969,23 @@
IRQF_SHARED, DRV_NAME, card);
if (ret) {
lbs_pr_err("error in request_irq\n");
+@@ -977,7 +1048,13 @@ MODULE_DEVICE_TABLE(pcmcia, if_cs_ids);
+
+ static struct pcmcia_driver lbs_driver = {
+ .owner = THIS_MODULE,
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
+ .name = DRV_NAME,
++#else
++ .drv = {
++ .name = DRV_NAME,
++ },
++#endif
+ .probe = if_cs_probe,
+ .remove = if_cs_detach,
+ .id_table = if_cs_ids,
--- a/drivers/net/wireless/orinoco/orinoco_cs.c
+++ b/drivers/net/wireless/orinoco/orinoco_cs.c
-@@ -79,7 +79,11 @@ orinoco_cs_hard_reset(struct orinoco_pri
+@@ -78,7 +78,11 @@ orinoco_cs_hard_reset(struct orinoco_pri
/* We need atomic ops here, because we're not holding the lock */
set_bit(0, &card->hard_reset_in_progress);
@@ -717,7 +997,7 @@
if (err)
return err;
-@@ -117,6 +121,12 @@ orinoco_cs_probe(struct pcmcia_device *l
+@@ -108,6 +112,16 @@ orinoco_cs_probe(struct pcmcia_device *l
card->p_dev = link;
link->priv = priv;
@@ -726,28 +1006,81 @@
+ link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
+ link->irq.Handler = orinoco_interrupt;
+#endif
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37))
++ link->conf.Attributes = 0;
++ link->conf.IntType = INT_MEMORY_AND_IO;
++#endif
+
- /* 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.,
-@@ -191,23 +201,48 @@ static int orinoco_cs_config_check(struc
- p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
+ return orinoco_cs_config(link);
+ } /* orinoco_cs_attach */
+
+@@ -122,6 +136,7 @@ static void orinoco_cs_detach(struct pcm
+ free_orinocodev(priv);
+ } /* orinoco_cs_detach */
- /* IO window settings */
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
+ static int orinoco_cs_config_check(struct pcmcia_device *p_dev, void *priv_data)
+ {
+ if (p_dev->config_index == 0)
+@@ -129,6 +144,98 @@ static int orinoco_cs_config_check(struc
+
+ return pcmcia_request_io(p_dev);
+ };
++#else
++static int orinoco_cs_config_check(struct pcmcia_device *p_dev,
++ cistpl_cftable_entry_t *cfg,
++ cistpl_cftable_entry_t *dflt,
++ unsigned int vcc,
++ void *priv_data)
++{
++ if (cfg->index == 0)
++ goto next_entry;
++
++ /* Use power settings for Vcc and Vpp if present */
++ /* Note that the CIS values need to be rescaled */
++ if (cfg->vcc.present & (1 << CISTPL_POWER_VNOM)) {
++ if (vcc != cfg->vcc.param[CISTPL_POWER_VNOM] / 10000) {
++ DEBUG(2, "%s: Vcc mismatch (vcc = %d, CIS = %d)\n",
++ __func__, vcc,
++ cfg->vcc.param[CISTPL_POWER_VNOM] / 10000);
++ if (!ignore_cis_vcc)
++ goto next_entry;
++ }
++ } else if (dflt->vcc.present & (1 << CISTPL_POWER_VNOM)) {
++ if (vcc != dflt->vcc.param[CISTPL_POWER_VNOM] / 10000) {
++ DEBUG(2, "%s: Vcc mismatch (vcc = %d, CIS = %d)\n",
++ __func__, vcc,
++ dflt->vcc.param[CISTPL_POWER_VNOM] / 10000);
++ if (!ignore_cis_vcc)
++ goto next_entry;
++ }
++ }
++
++ if (cfg->vpp1.present & (1 << CISTPL_POWER_VNOM))
++ p_dev->conf.Vpp =
++ cfg->vpp1.param[CISTPL_POWER_VNOM] / 10000;
++ else if (dflt->vpp1.present & (1 << CISTPL_POWER_VNOM))
++ p_dev->conf.Vpp =
++ dflt->vpp1.param[CISTPL_POWER_VNOM] / 10000;
++
++ /* Do we need to allocate an interrupt? */
++ 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;
++ 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 ((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;
++ 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))
@@ -758,28 +1091,50 @@
+ p_dev->io.BasePort1 = io->win[0].base;
+ p_dev->io.NumPorts1 = io->win[0].len;
+#endif
- if (io->nwin > 1) {
++ 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;
++ 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 */
++ }
++
++ /* 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)
++ 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 next_entry;
++ }
++ return 0;
++
++next_entry:
++ pcmcia_disable_device(p_dev);
++ return -ENODEV;
++};
++#endif
+
+ static int
+ orinoco_cs_config(struct pcmcia_device *link)
+@@ -138,10 +245,12 @@ orinoco_cs_config(struct pcmcia_device *
+ int ret;
+ void __iomem *mem;
+
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
+ link->config_flags |= CONF_AUTO_SET_VPP | CONF_AUTO_CHECK_VCC |
+ CONF_AUTO_SET_IO | CONF_ENABLE_IRQ;
+ if (ignore_cis_vcc)
+ link->config_flags &= ~CONF_AUTO_CHECK_VCC;
++#endif
+ ret = pcmcia_loop_config(link, orinoco_cs_config_check, NULL);
+ if (ret) {
+ if (!ignore_cis_vcc)
+@@ -151,15 +260,23 @@ orinoco_cs_config(struct pcmcia_device *
goto failed;
}
@@ -803,7 +1158,7 @@
if (!mem)
goto failed;
-@@ -278,8 +321,16 @@ orinoco_cs_config(struct pcmcia_device *
+@@ -176,8 +293,16 @@ orinoco_cs_config(struct pcmcia_device *
}
/* Register an interface with the stack */
@@ -820,9 +1175,23 @@
printk(KERN_ERR PFX "orinoco_if_add() failed\n");
goto failed;
}
+@@ -328,7 +453,13 @@ MODULE_DEVICE_TABLE(pcmcia, orinoco_cs_i
+
+ static struct pcmcia_driver orinoco_driver = {
+ .owner = THIS_MODULE,
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
+ .name = DRIVER_NAME,
++#else
++ .drv = {
++ .name = DRIVER_NAME,
++ },
++#endif
+ .probe = orinoco_cs_probe,
+ .remove = orinoco_cs_detach,
+ .id_table = orinoco_cs_ids,
--- a/drivers/net/wireless/orinoco/spectrum_cs.c
+++ b/drivers/net/wireless/orinoco/spectrum_cs.c
-@@ -179,6 +179,12 @@ spectrum_cs_probe(struct pcmcia_device *
+@@ -170,6 +170,16 @@ spectrum_cs_probe(struct pcmcia_device *
card->p_dev = link;
link->priv = priv;
@@ -831,28 +1200,81 @@
+ link->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
+ link->irq.Handler = orinoco_interrupt;
+#endif
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,6,37))
++ link->conf.Attributes = 0;
++ link->conf.IntType = INT_MEMORY_AND_IO;
++#endif
+
- /* 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.,
-@@ -253,23 +259,48 @@ static int spectrum_cs_config_check(stru
- p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
+ return spectrum_cs_config(link);
+ } /* spectrum_cs_attach */
+
+@@ -184,6 +194,7 @@ static void spectrum_cs_detach(struct pc
+ free_orinocodev(priv);
+ } /* spectrum_cs_detach */
+
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
+ static int spectrum_cs_config_check(struct pcmcia_device *p_dev,
+ void *priv_data)
+ {
+@@ -192,6 +203,98 @@ static int spectrum_cs_config_check(stru
- /* IO window settings */
+ return pcmcia_request_io(p_dev);
+ };
++#else
++static int spectrum_cs_config_check(struct pcmcia_device *p_dev,
++ cistpl_cftable_entry_t *cfg,
++ cistpl_cftable_entry_t *dflt,
++ unsigned int vcc,
++ void *priv_data)
++{
++ if (cfg->index == 0)
++ goto next_entry;
++
++ /* Use power settings for Vcc and Vpp if present */
++ /* Note that the CIS values need to be rescaled */
++ if (cfg->vcc.present & (1 << CISTPL_POWER_VNOM)) {
++ if (vcc != cfg->vcc.param[CISTPL_POWER_VNOM] / 10000) {
++ DEBUG(2, "%s: Vcc mismatch (vcc = %d, CIS = %d)\n",
++ __func__, vcc,
++ cfg->vcc.param[CISTPL_POWER_VNOM] / 10000);
++ if (!ignore_cis_vcc)
++ goto next_entry;
++ }
++ } else if (dflt->vcc.present & (1 << CISTPL_POWER_VNOM)) {
++ if (vcc != dflt->vcc.param[CISTPL_POWER_VNOM] / 10000) {
++ DEBUG(2, "%s: Vcc mismatch (vcc = %d, CIS = %d)\n",
++ __func__, vcc,
++ dflt->vcc.param[CISTPL_POWER_VNOM] / 10000);
++ if (!ignore_cis_vcc)
++ goto next_entry;
++ }
++ }
++
++ if (cfg->vpp1.present & (1 << CISTPL_POWER_VNOM))
++ p_dev->conf.Vpp =
++ cfg->vpp1.param[CISTPL_POWER_VNOM] / 10000;
++ else if (dflt->vpp1.present & (1 << CISTPL_POWER_VNOM))
++ p_dev->conf.Vpp =
++ dflt->vpp1.param[CISTPL_POWER_VNOM] / 10000;
++
++ /* Do we need to allocate an interrupt? */
++ 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;
++ 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 ((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;
++ 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))
@@ -863,28 +1285,50 @@
+ p_dev->io.BasePort1 = io->win[0].base;
+ p_dev->io.NumPorts1 = io->win[0].len;
+#endif
- if (io->nwin > 1) {
++ 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;
++ 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 */
++ }
++
++ /* 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)
++ 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 next_entry;
++ }
++ return 0;
++
++next_entry:
++ pcmcia_disable_device(p_dev);
++ return -ENODEV;
++};
++#endif
+
+ static int
+ spectrum_cs_config(struct pcmcia_device *link)
+@@ -201,10 +304,12 @@ spectrum_cs_config(struct pcmcia_device
+ int ret;
+ void __iomem *mem;
+
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
+ link->config_flags |= CONF_AUTO_SET_VPP | CONF_AUTO_CHECK_VCC |
+ CONF_AUTO_SET_IO | CONF_ENABLE_IRQ;
+ if (ignore_cis_vcc)
+ link->config_flags &= ~CONF_AUTO_CHECK_VCC;
++#endif
+ ret = pcmcia_loop_config(link, spectrum_cs_config_check, NULL);
+ if (ret) {
+ if (!ignore_cis_vcc)
+@@ -214,15 +319,23 @@ spectrum_cs_config(struct pcmcia_device
goto failed;
}
@@ -908,7 +1352,7 @@
if (!mem)
goto failed;
-@@ -345,8 +384,16 @@ spectrum_cs_config(struct pcmcia_device
+@@ -244,8 +357,16 @@ spectrum_cs_config(struct pcmcia_device
}
/* Register an interface with the stack */
@@ -925,9 +1369,23 @@
printk(KERN_ERR PFX "orinoco_if_add() failed\n");
goto failed;
}
+@@ -311,7 +432,13 @@ MODULE_DEVICE_TABLE(pcmcia, spectrum_cs_
+
+ static struct pcmcia_driver orinoco_driver = {
+ .owner = THIS_MODULE,
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
+ .name = DRIVER_NAME,
++#else
++ .drv = {
++ .name = DRIVER_NAME,
++ },
++#endif
+ .probe = spectrum_cs_probe,
+ .remove = spectrum_cs_detach,
+ .suspend = spectrum_cs_suspend,
--- a/drivers/ssb/main.c
+++ b/drivers/ssb/main.c
-@@ -490,7 +490,11 @@ static int ssb_devices_register(struct s
+@@ -489,7 +489,11 @@ static int ssb_devices_register(struct s
break;
case SSB_BUSTYPE_PCMCIA:
#ifdef CONFIG_SSB_PCMCIAHOST
--
1.7.0.4
^ permalink raw reply related [flat|nested] 9+ messages in thread
* Re: [PATCH 2/2 v2] compat-wireless: "backport" pcmcia api changes.
2010-09-19 17:56 ` [PATCH 2/2 v2] " Hauke Mehrtens
@ 2010-09-20 15:26 ` Luis R. Rodriguez
2010-09-20 15:33 ` Luis R. Rodriguez
2010-09-20 19:28 ` Hauke Mehrtens
0 siblings, 2 replies; 9+ messages in thread
From: Luis R. Rodriguez @ 2010-09-20 15:26 UTC (permalink / raw)
To: Hauke Mehrtens; +Cc: linux-wireless, mcgrof
On Sun, Sep 19, 2010 at 10:56 AM, Hauke Mehrtens <hauke@hauke-m.de> wrote:
> The PCMCIA API changed again.
> This patch was only compile tested, beacuse I do not have devices to
> test this.
>
> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
mcgrof@tux ~/devel/compat-wireless-2.6 (git::master)$ patch -p1 <
/home/mcgrof/patches/2010/09/20/02-cw.patch
patching file patches/24-pcmcia.patch
Hunk #1 succeeded at 1 with fuzz 1.
Hunk #2 FAILED at 13.
Hunk #3 FAILED at 25.
Hunk #4 FAILED at 37.
Hunk #5 FAILED at 49.
Hunk #6 FAILED at 61.
Hunk #7 FAILED at 73.
Hunk #8 FAILED at 85.
Hunk #9 FAILED at 97.
Hunk #10 FAILED at 109.
Hunk #11 FAILED at 119.
Hunk #12 FAILED at 147.
Hunk #13 FAILED at 161.
Hunk #14 FAILED at 177.
Hunk #15 FAILED at 189.
Hunk #16 FAILED at 201.
Hunk #17 FAILED at 213.
Hunk #18 FAILED at 230.
Hunk #19 FAILED at 287.
Hunk #20 FAILED at 303.
Hunk #21 FAILED at 315.
Hunk #22 FAILED at 327.
Hunk #23 FAILED at 339.
Hunk #24 FAILED at 351.
Hunk #25 FAILED at 363.
Hunk #26 FAILED at 380.
Hunk #27 FAILED at 437.
Hunk #28 FAILED at 453.
Hunk #29 FAILED at 465.
Hunk #30 FAILED at 477.
Hunk #31 FAILED at 489.
Hunk #32 FAILED at 503.
Hunk #33 FAILED at 515.
Hunk #34 FAILED at 530.
Hunk #35 FAILED at 573.
Hunk #36 FAILED at 591.
Hunk #37 FAILED at 606.
Hunk #38 FAILED at 634.
Hunk #39 FAILED at 673.
Hunk #40 FAILED at 691.
Hunk #41 FAILED at 703.
Hunk #42 FAILED at 717.
Hunk #43 FAILED at 726.
Hunk #44 FAILED at 758.
Hunk #45 FAILED at 803.
Hunk #46 FAILED at 820.
Hunk #47 FAILED at 831.
Hunk #48 FAILED at 863.
Hunk #49 FAILED at 908.
Hunk #50 FAILED at 925.
49 out of 50 hunks FAILED -- saving rejects to file patches/24-pcmcia.patch.rej
We should just remove PCMCIA, at the summit no Linux distribution
present indicated their desire to keep it alive and maintained within
compat-wireless. This should save us some work.
Luis
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 2/2 v2] compat-wireless: "backport" pcmcia api changes.
2010-09-20 15:26 ` Luis R. Rodriguez
@ 2010-09-20 15:33 ` Luis R. Rodriguez
2010-09-20 19:28 ` Hauke Mehrtens
1 sibling, 0 replies; 9+ messages in thread
From: Luis R. Rodriguez @ 2010-09-20 15:33 UTC (permalink / raw)
To: Hauke Mehrtens; +Cc: linux-wireless, mcgrof
On Mon, Sep 20, 2010 at 8:26 AM, Luis R. Rodriguez
<lrodriguez@atheros.com> wrote:
> On Sun, Sep 19, 2010 at 10:56 AM, Hauke Mehrtens <hauke@hauke-m.de> wrote:
>> The PCMCIA API changed again.
>> This patch was only compile tested, beacuse I do not have devices to
>> test this.
>>
>> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
>
> mcgrof@tux ~/devel/compat-wireless-2.6 (git::master)$ patch -p1 <
> /home/mcgrof/patches/2010/09/20/02-cw.patch
> patching file patches/24-pcmcia.patch
> Hunk #1 succeeded at 1 with fuzz 1.
> Hunk #2 FAILED at 13.
> Hunk #3 FAILED at 25.
> Hunk #4 FAILED at 37.
> Hunk #5 FAILED at 49.
> Hunk #6 FAILED at 61.
> Hunk #7 FAILED at 73.
> Hunk #8 FAILED at 85.
> Hunk #9 FAILED at 97.
> Hunk #10 FAILED at 109.
> Hunk #11 FAILED at 119.
> Hunk #12 FAILED at 147.
> Hunk #13 FAILED at 161.
> Hunk #14 FAILED at 177.
> Hunk #15 FAILED at 189.
> Hunk #16 FAILED at 201.
> Hunk #17 FAILED at 213.
> Hunk #18 FAILED at 230.
> Hunk #19 FAILED at 287.
> Hunk #20 FAILED at 303.
> Hunk #21 FAILED at 315.
> Hunk #22 FAILED at 327.
> Hunk #23 FAILED at 339.
> Hunk #24 FAILED at 351.
> Hunk #25 FAILED at 363.
> Hunk #26 FAILED at 380.
> Hunk #27 FAILED at 437.
> Hunk #28 FAILED at 453.
> Hunk #29 FAILED at 465.
> Hunk #30 FAILED at 477.
> Hunk #31 FAILED at 489.
> Hunk #32 FAILED at 503.
> Hunk #33 FAILED at 515.
> Hunk #34 FAILED at 530.
> Hunk #35 FAILED at 573.
> Hunk #36 FAILED at 591.
> Hunk #37 FAILED at 606.
> Hunk #38 FAILED at 634.
> Hunk #39 FAILED at 673.
> Hunk #40 FAILED at 691.
> Hunk #41 FAILED at 703.
> Hunk #42 FAILED at 717.
> Hunk #43 FAILED at 726.
> Hunk #44 FAILED at 758.
> Hunk #45 FAILED at 803.
> Hunk #46 FAILED at 820.
> Hunk #47 FAILED at 831.
> Hunk #48 FAILED at 863.
> Hunk #49 FAILED at 908.
> Hunk #50 FAILED at 925.
> 49 out of 50 hunks FAILED -- saving rejects to file patches/24-pcmcia.patch.rej
>
> We should just remove PCMCIA, at the summit no Linux distribution
> present indicated their desire to keep it alive and maintained within
> compat-wireless. This should save us some work.
Applied the other 3/4 patches though, thanks!
Luis
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 2/2 v2] compat-wireless: "backport" pcmcia api changes.
2010-09-20 15:26 ` Luis R. Rodriguez
2010-09-20 15:33 ` Luis R. Rodriguez
@ 2010-09-20 19:28 ` Hauke Mehrtens
2010-09-20 20:04 ` Luis R. Rodriguez
1 sibling, 1 reply; 9+ messages in thread
From: Hauke Mehrtens @ 2010-09-20 19:28 UTC (permalink / raw)
To: Luis R. Rodriguez; +Cc: linux-wireless, mcgrof
On 20.09.2010 17:26, Luis R. Rodriguez wrote:
> On Sun, Sep 19, 2010 at 10:56 AM, Hauke Mehrtens <hauke@hauke-m.de> wrote:
>> The PCMCIA API changed again.
>> This patch was only compile tested, beacuse I do not have devices to
>> test this.
>>
>> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
>
> mcgrof@tux ~/devel/compat-wireless-2.6 (git::master)$ patch -p1 <
> /home/mcgrof/patches/2010/09/20/02-cw.patch
> patching file patches/24-pcmcia.patch
> Hunk #1 succeeded at 1 with fuzz 1.
> Hunk #2 FAILED at 13.
.....
> 49 out of 50 hunks FAILED -- saving rejects to file patches/24-pcmcia.patch.rej
>
> We should just remove PCMCIA, at the summit no Linux distribution
> present indicated their desire to keep it alive and maintained within
> compat-wireless. This should save us some work.
>
> Luis
Hi Luis
That is strange. Something must have went wrong when applying this
patch. I just checked out a fresh compat-wireless tree and tried to
apply the mail with git am ... and it worked with some warnings.
When the next big API change in the pcmcia subsystem arrives we should
really drop it, but for now it should at least compile and probably
work. I will resend the a patch rebased on todays compat-wireless.
Hauke
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH 2/2 v2] compat-wireless: "backport" pcmcia api changes.
2010-09-20 19:28 ` Hauke Mehrtens
@ 2010-09-20 20:04 ` Luis R. Rodriguez
0 siblings, 0 replies; 9+ messages in thread
From: Luis R. Rodriguez @ 2010-09-20 20:04 UTC (permalink / raw)
To: Hauke Mehrtens
Cc: Luis Rodriguez, linux-wireless@vger.kernel.org,
mcgrof@infradead.org
On Mon, Sep 20, 2010 at 12:28:38PM -0700, Hauke Mehrtens wrote:
> On 20.09.2010 17:26, Luis R. Rodriguez wrote:
> > On Sun, Sep 19, 2010 at 10:56 AM, Hauke Mehrtens <hauke@hauke-m.de> wrote:
> >> The PCMCIA API changed again.
> >> This patch was only compile tested, beacuse I do not have devices to
> >> test this.
> >>
> >> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
> >
> > mcgrof@tux ~/devel/compat-wireless-2.6 (git::master)$ patch -p1 <
> > /home/mcgrof/patches/2010/09/20/02-cw.patch
> > patching file patches/24-pcmcia.patch
> > Hunk #1 succeeded at 1 with fuzz 1.
> > Hunk #2 FAILED at 13.
> .....
> > 49 out of 50 hunks FAILED -- saving rejects to file patches/24-pcmcia.patch.rej
> >
> > We should just remove PCMCIA, at the summit no Linux distribution
> > present indicated their desire to keep it alive and maintained within
> > compat-wireless. This should save us some work.
> >
> > Luis
> Hi Luis
>
> That is strange. Something must have went wrong when applying this
> patch. I just checked out a fresh compat-wireless tree and tried to
> apply the mail with git am ... and it worked with some warnings.
>
> When the next big API change in the pcmcia subsystem arrives we should
> really drop it, but for now it should at least compile and probably
> work. I will resend the a patch rebased on todays compat-wireless.
Applied and pushed thanks.
Luis
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2010-09-20 20:04 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-09-19 17:46 [PATCH 1/4] compat-wireless: make patches apply again Hauke Mehrtens
2010-09-19 17:49 ` [PATCH 2/4] compat-wireless: "backport" pcmcia api changes Hauke Mehrtens
2010-09-19 17:56 ` [PATCH 2/2 v2] " Hauke Mehrtens
2010-09-20 15:26 ` Luis R. Rodriguez
2010-09-20 15:33 ` Luis R. Rodriguez
2010-09-20 19:28 ` Hauke Mehrtens
2010-09-20 20:04 ` Luis R. Rodriguez
2010-09-19 17:49 ` [PATCH 3/4] compat-wirelsss: add carl9170 Hauke Mehrtens
2010-09-19 17:49 ` [PATCH 4/4] compat-wireless: fix unresolved symbols with old kernels Hauke Mehrtens
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).