aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/pcmcia/ipwireless/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/pcmcia/ipwireless/main.c')
-rw-r--r--drivers/char/pcmcia/ipwireless/main.c26
1 files changed, 7 insertions, 19 deletions
diff --git a/drivers/char/pcmcia/ipwireless/main.c b/drivers/char/pcmcia/ipwireless/main.c
index 1b7f0920737b..594c23be69f5 100644
--- a/drivers/char/pcmcia/ipwireless/main.c
+++ b/drivers/char/pcmcia/ipwireless/main.c
@@ -75,22 +75,18 @@ static void signalled_reboot_callback(void *callback_data)
75 schedule_work(&ipw->work_reboot); 75 schedule_work(&ipw->work_reboot);
76} 76}
77 77
78static int ipwireless_probe(struct pcmcia_device *p_dev, 78static int ipwireless_probe(struct pcmcia_device *p_dev, void *priv_data)
79 cistpl_cftable_entry_t *cfg,
80 cistpl_cftable_entry_t *dflt,
81 void *priv_data)
82{ 79{
83 struct ipw_dev *ipw = priv_data; 80 struct ipw_dev *ipw = priv_data;
84 struct resource *io_resource; 81 struct resource *io_resource;
85 int ret; 82 int ret;
86 83
84 p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH;
87 p_dev->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO; 85 p_dev->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
88 p_dev->resource[0]->start = cfg->io.win[0].base;
89 p_dev->resource[0]->end = cfg->io.win[0].len;
90 86
91 /* 0x40 causes it to generate level mode interrupts. */ 87 /* 0x40 causes it to generate level mode interrupts. */
92 /* 0x04 enables IREQ pin. */ 88 /* 0x04 enables IREQ pin. */
93 p_dev->config_index = cfg->index | 0x44; 89 p_dev->config_index |= 0x44;
94 p_dev->io_lines = 16; 90 p_dev->io_lines = 16;
95 ret = pcmcia_request_io(p_dev); 91 ret = pcmcia_request_io(p_dev);
96 if (ret) 92 if (ret)
@@ -100,26 +96,18 @@ static int ipwireless_probe(struct pcmcia_device *p_dev,
100 resource_size(p_dev->resource[0]), 96 resource_size(p_dev->resource[0]),
101 IPWIRELESS_PCCARD_NAME); 97 IPWIRELESS_PCCARD_NAME);
102 98
103 if (cfg->mem.nwin == 0)
104 return 0;
105
106 p_dev->resource[2]->flags |= 99 p_dev->resource[2]->flags |=
107 WIN_DATA_WIDTH_16 | WIN_MEMORY_TYPE_CM | WIN_ENABLE; 100 WIN_DATA_WIDTH_16 | WIN_MEMORY_TYPE_CM | WIN_ENABLE;
108 p_dev->resource[2]->start = cfg->mem.win[0].host_addr;
109 p_dev->resource[2]->end = cfg->mem.win[0].len;
110 if (p_dev->resource[2]->end < 0x1000)
111 p_dev->resource[2]->end = 0x1000;
112 101
113 ret = pcmcia_request_window(p_dev, p_dev->resource[2], 0); 102 ret = pcmcia_request_window(p_dev, p_dev->resource[2], 0);
114 if (ret != 0) 103 if (ret != 0)
115 goto exit1; 104 goto exit1;
116 105
117 ret = pcmcia_map_mem_page(p_dev, p_dev->resource[2], 106 ret = pcmcia_map_mem_page(p_dev, p_dev->resource[2], p_dev->card_addr);
118 cfg->mem.win[0].card_addr);
119 if (ret != 0) 107 if (ret != 0)
120 goto exit2; 108 goto exit2;
121 109
122 ipw->is_v2_card = cfg->mem.win[0].len == 0x100; 110 ipw->is_v2_card = resource_size(p_dev->resource[2]) == 0x100;
123 111
124 ipw->attr_memory = ioremap(p_dev->resource[2]->start, 112 ipw->attr_memory = ioremap(p_dev->resource[2]->start,
125 resource_size(p_dev->resource[2])); 113 resource_size(p_dev->resource[2]));
@@ -165,13 +153,13 @@ static int config_ipwireless(struct ipw_dev *ipw)
165 int ret = 0; 153 int ret = 0;
166 154
167 ipw->is_v2_card = 0; 155 ipw->is_v2_card = 0;
156 link->config_flags |= CONF_AUTO_SET_IO | CONF_AUTO_SET_IOMEM |
157 CONF_ENABLE_IRQ;
168 158
169 ret = pcmcia_loop_config(link, ipwireless_probe, ipw); 159 ret = pcmcia_loop_config(link, ipwireless_probe, ipw);
170 if (ret != 0) 160 if (ret != 0)
171 return ret; 161 return ret;
172 162
173 link->config_flags |= CONF_ENABLE_IRQ;
174
175 INIT_WORK(&ipw->work_reboot, signalled_reboot_work); 163 INIT_WORK(&ipw->work_reboot, signalled_reboot_work);
176 164
177 ipwireless_init_hardware_v1(ipw->hardware, link->resource[0]->start, 165 ipwireless_init_hardware_v1(ipw->hardware, link->resource[0]->start,