26 #include <linux/kernel.h>
27 #include <linux/module.h>
28 #include <linux/sched.h>
29 #include <linux/slab.h>
37 PCMCIA_DEVICE_MANF_CARD(0x02f2, 0x0100),
38 PCMCIA_DEVICE_MANF_CARD(0x02f2, 0x0200),
43 static void ipwireless_detach(
struct pcmcia_device *
link);
58 "debug: enable ras_raw channel [0]");
62 static void signalled_reboot_work(
struct work_struct *work_reboot)
66 struct pcmcia_device *
link = ipw->
link;
70 static void signalled_reboot_callback(
void *callback_data)
78 static int ipwireless_probe(
struct pcmcia_device *p_dev,
void *priv_data)
80 struct ipw_dev *ipw = priv_data;
83 p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH;
84 p_dev->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
88 p_dev->config_index |= 0x44;
95 resource_size(p_dev->resource[0]),
101 p_dev->resource[2]->flags |=
102 WIN_DATA_WIDTH_16 | WIN_MEMORY_TYPE_CM |
WIN_ENABLE;
112 ipw->
is_v2_card = resource_size(p_dev->resource[2]) == 0x100;
115 resource_size(p_dev->resource[2]));
117 resource_size(p_dev->resource[2]),
123 p_dev->resource[3]->flags |= WIN_DATA_WIDTH_16 | WIN_MEMORY_TYPE_AM |
125 p_dev->resource[3]->end = 0;
135 resource_size(p_dev->resource[3]));
137 resource_size(p_dev->resource[3]),
149 resource_size(p_dev->resource[2]));
154 resource_size(p_dev->resource[0]));
160 static int config_ipwireless(
struct ipw_dev *ipw)
162 struct pcmcia_device *
link = ipw->
link;
166 link->config_flags |= CONF_AUTO_SET_IO | CONF_AUTO_SET_IOMEM |
169 ret = pcmcia_loop_config(link, ipwireless_probe, ipw);
187 ": I/O ports %pR, irq %d\n", link->resource[0],
188 (
unsigned int) link->irq);
191 ": attr memory %pR, common memory %pR\n",
218 resource_size(link->resource[2]));
223 resource_size(link->resource[3]));
230 static void release_ipwireless(
struct ipw_dev *ipw)
233 resource_size(ipw->
link->resource[0]));
236 resource_size(ipw->
link->resource[2]));
241 resource_size(ipw->
link->resource[3]));
256 static int ipwireless_attach(
struct pcmcia_device *link)
275 ret = config_ipwireless(ipw);
278 ipwireless_detach(link);
291 static void ipwireless_detach(
struct pcmcia_device *link)
293 struct ipw_dev *ipw = link->priv;
295 release_ipwireless(ipw);
306 static struct pcmcia_driver me = {
308 .probe = ipwireless_attach,
309 .remove = ipwireless_detach,
318 static int __init init_ipwireless(
void)
336 static void __exit exit_ipwireless(
void)