diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-21 17:25:16 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-10-21 17:25:16 -0400 |
commit | b65378898c2eefb20f419632c1199bc0592e2f79 (patch) | |
tree | 052bb72d329c44790f91fc8097b8500d4774d02c /drivers/char | |
parent | 157b6ceb13e4b4148ee03dd517dbe88748943125 (diff) | |
parent | 5b917a1420d3d1a9c8da49fb0090692dc9aaee86 (diff) |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6: (22 commits)
pcmcia: synclink_cs: fix information leak to userland
pcmcia: don't call flush_scheduled_work() spuriously
serial_cs: drop spurious flush_scheduled_work() call
pcmcia/yenta: guide users in case of problems with O2-bridges
pcmcia: fix unused function compile warning
pcmcia: vrc4173_cardu: Fix error path for pci_release_regions and pci_disable_device
pcmcia: add a few debug statements
pcmcia: remove obsolete and wrong comments
pcmcia: avoid messages on module (un)loading
pcmcia: move driver name to struct pcmcia_driver
pcmcia: remove the "Finally, report what we've done" message
pcmcia: use autoconfiguration feature for ioports and iomem
pcmcia: introduce autoconfiguration feature
pcmcia: Documentation update
pcmcia: convert pcmcia_request_configuration to pcmcia_enable_device
pcmcia: move config_{base,index,regs} to struct pcmcia_device
pcmcia: simplify IntType
pcmcia: simplify Status, ExtStatus register access
pcmcia: remove Pin, Copy configuration register access
pcmcia: move Vpp setup to struct pcmcia_device
...
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/pcmcia/cm4000_cs.c | 31 | ||||
-rw-r--r-- | drivers/char/pcmcia/cm4040_cs.c | 40 | ||||
-rw-r--r-- | drivers/char/pcmcia/ipwireless/main.c | 117 | ||||
-rw-r--r-- | drivers/char/pcmcia/ipwireless/main.h | 5 | ||||
-rw-r--r-- | drivers/char/pcmcia/ipwireless/tty.h | 1 | ||||
-rw-r--r-- | drivers/char/pcmcia/synclink_cs.c | 46 |
6 files changed, 62 insertions, 178 deletions
diff --git a/drivers/char/pcmcia/cm4000_cs.c b/drivers/char/pcmcia/cm4000_cs.c index ec73d9f6d9ed..c7b482d15e2a 100644 --- a/drivers/char/pcmcia/cm4000_cs.c +++ b/drivers/char/pcmcia/cm4000_cs.c | |||
@@ -34,7 +34,6 @@ | |||
34 | #include <linux/uaccess.h> | 34 | #include <linux/uaccess.h> |
35 | #include <linux/io.h> | 35 | #include <linux/io.h> |
36 | 36 | ||
37 | #include <pcmcia/cs.h> | ||
38 | #include <pcmcia/cistpl.h> | 37 | #include <pcmcia/cistpl.h> |
39 | #include <pcmcia/cisreg.h> | 38 | #include <pcmcia/cisreg.h> |
40 | #include <pcmcia/ciscode.h> | 39 | #include <pcmcia/ciscode.h> |
@@ -55,8 +54,6 @@ | |||
55 | __func__ , ## args); \ | 54 | __func__ , ## args); \ |
56 | } while (0) | 55 | } while (0) |
57 | 56 | ||
58 | static char *version = "cm4000_cs.c v2.4.0gm6 - All bugs added by Harald Welte"; | ||
59 | |||
60 | #define T_1SEC (HZ) | 57 | #define T_1SEC (HZ) |
61 | #define T_10MSEC msecs_to_jiffies(10) | 58 | #define T_10MSEC msecs_to_jiffies(10) |
62 | #define T_20MSEC msecs_to_jiffies(20) | 59 | #define T_20MSEC msecs_to_jiffies(20) |
@@ -1742,20 +1739,8 @@ static void cmm_cm4000_release(struct pcmcia_device * link) | |||
1742 | 1739 | ||
1743 | /*==== Interface to PCMCIA Layer =======================================*/ | 1740 | /*==== Interface to PCMCIA Layer =======================================*/ |
1744 | 1741 | ||
1745 | static int cm4000_config_check(struct pcmcia_device *p_dev, | 1742 | static int cm4000_config_check(struct pcmcia_device *p_dev, void *priv_data) |
1746 | cistpl_cftable_entry_t *cfg, | ||
1747 | cistpl_cftable_entry_t *dflt, | ||
1748 | unsigned int vcc, | ||
1749 | void *priv_data) | ||
1750 | { | 1743 | { |
1751 | if (!cfg->io.nwin) | ||
1752 | return -ENODEV; | ||
1753 | |||
1754 | p_dev->resource[0]->start = cfg->io.win[0].base; | ||
1755 | p_dev->resource[0]->end = cfg->io.win[0].len; | ||
1756 | p_dev->resource[0]->flags |= pcmcia_io_cfg_data_width(cfg->io.flags); | ||
1757 | p_dev->io_lines = cfg->io.flags & CISTPL_IO_LINES_MASK; | ||
1758 | |||
1759 | return pcmcia_request_io(p_dev); | 1744 | return pcmcia_request_io(p_dev); |
1760 | } | 1745 | } |
1761 | 1746 | ||
@@ -1763,13 +1748,13 @@ static int cm4000_config(struct pcmcia_device * link, int devno) | |||
1763 | { | 1748 | { |
1764 | struct cm4000_dev *dev; | 1749 | struct cm4000_dev *dev; |
1765 | 1750 | ||
1751 | link->config_flags |= CONF_AUTO_SET_IO; | ||
1752 | |||
1766 | /* read the config-tuples */ | 1753 | /* read the config-tuples */ |
1767 | if (pcmcia_loop_config(link, cm4000_config_check, NULL)) | 1754 | if (pcmcia_loop_config(link, cm4000_config_check, NULL)) |
1768 | goto cs_release; | 1755 | goto cs_release; |
1769 | 1756 | ||
1770 | link->conf.IntType = 00000002; | 1757 | if (pcmcia_enable_device(link)) |
1771 | |||
1772 | if (pcmcia_request_configuration(link, &link->conf)) | ||
1773 | goto cs_release; | 1758 | goto cs_release; |
1774 | 1759 | ||
1775 | dev = link->priv; | 1760 | dev = link->priv; |
@@ -1829,7 +1814,6 @@ static int cm4000_probe(struct pcmcia_device *link) | |||
1829 | 1814 | ||
1830 | dev->p_dev = link; | 1815 | dev->p_dev = link; |
1831 | link->priv = dev; | 1816 | link->priv = dev; |
1832 | link->conf.IntType = INT_MEMORY_AND_IO; | ||
1833 | dev_table[i] = link; | 1817 | dev_table[i] = link; |
1834 | 1818 | ||
1835 | init_waitqueue_head(&dev->devq); | 1819 | init_waitqueue_head(&dev->devq); |
@@ -1891,9 +1875,7 @@ MODULE_DEVICE_TABLE(pcmcia, cm4000_ids); | |||
1891 | 1875 | ||
1892 | static struct pcmcia_driver cm4000_driver = { | 1876 | static struct pcmcia_driver cm4000_driver = { |
1893 | .owner = THIS_MODULE, | 1877 | .owner = THIS_MODULE, |
1894 | .drv = { | 1878 | .name = "cm4000_cs", |
1895 | .name = "cm4000_cs", | ||
1896 | }, | ||
1897 | .probe = cm4000_probe, | 1879 | .probe = cm4000_probe, |
1898 | .remove = cm4000_detach, | 1880 | .remove = cm4000_detach, |
1899 | .suspend = cm4000_suspend, | 1881 | .suspend = cm4000_suspend, |
@@ -1905,8 +1887,6 @@ static int __init cmm_init(void) | |||
1905 | { | 1887 | { |
1906 | int rc; | 1888 | int rc; |
1907 | 1889 | ||
1908 | printk(KERN_INFO "%s\n", version); | ||
1909 | |||
1910 | cmm_class = class_create(THIS_MODULE, "cardman_4000"); | 1890 | cmm_class = class_create(THIS_MODULE, "cardman_4000"); |
1911 | if (IS_ERR(cmm_class)) | 1891 | if (IS_ERR(cmm_class)) |
1912 | return PTR_ERR(cmm_class); | 1892 | return PTR_ERR(cmm_class); |
@@ -1931,7 +1911,6 @@ static int __init cmm_init(void) | |||
1931 | 1911 | ||
1932 | static void __exit cmm_exit(void) | 1912 | static void __exit cmm_exit(void) |
1933 | { | 1913 | { |
1934 | printk(KERN_INFO MODULE_NAME ": unloading\n"); | ||
1935 | pcmcia_unregister_driver(&cm4000_driver); | 1914 | pcmcia_unregister_driver(&cm4000_driver); |
1936 | unregister_chrdev(major, DEVICE_NAME); | 1915 | unregister_chrdev(major, DEVICE_NAME); |
1937 | class_destroy(cmm_class); | 1916 | class_destroy(cmm_class); |
diff --git a/drivers/char/pcmcia/cm4040_cs.c b/drivers/char/pcmcia/cm4040_cs.c index 815cde1d0570..bf2f046fc2c1 100644 --- a/drivers/char/pcmcia/cm4040_cs.c +++ b/drivers/char/pcmcia/cm4040_cs.c | |||
@@ -29,7 +29,6 @@ | |||
29 | #include <asm/uaccess.h> | 29 | #include <asm/uaccess.h> |
30 | #include <asm/io.h> | 30 | #include <asm/io.h> |
31 | 31 | ||
32 | #include <pcmcia/cs.h> | ||
33 | #include <pcmcia/cistpl.h> | 32 | #include <pcmcia/cistpl.h> |
34 | #include <pcmcia/cisreg.h> | 33 | #include <pcmcia/cisreg.h> |
35 | #include <pcmcia/ciscode.h> | 34 | #include <pcmcia/ciscode.h> |
@@ -49,9 +48,6 @@ | |||
49 | __func__ , ## args); \ | 48 | __func__ , ## args); \ |
50 | } while (0) | 49 | } while (0) |
51 | 50 | ||
52 | static char *version = | ||
53 | "OMNIKEY CardMan 4040 v1.1.0gm5 - All bugs added by Harald Welte"; | ||
54 | |||
55 | #define CCID_DRIVER_BULK_DEFAULT_TIMEOUT (150*HZ) | 51 | #define CCID_DRIVER_BULK_DEFAULT_TIMEOUT (150*HZ) |
56 | #define CCID_DRIVER_ASYNC_POWERUP_TIMEOUT (35*HZ) | 52 | #define CCID_DRIVER_ASYNC_POWERUP_TIMEOUT (35*HZ) |
57 | #define CCID_DRIVER_MINIMUM_TIMEOUT (3*HZ) | 53 | #define CCID_DRIVER_MINIMUM_TIMEOUT (3*HZ) |
@@ -516,26 +512,9 @@ static void cm4040_reader_release(struct pcmcia_device *link) | |||
516 | return; | 512 | return; |
517 | } | 513 | } |
518 | 514 | ||
519 | static int cm4040_config_check(struct pcmcia_device *p_dev, | 515 | static int cm4040_config_check(struct pcmcia_device *p_dev, void *priv_data) |
520 | cistpl_cftable_entry_t *cfg, | ||
521 | cistpl_cftable_entry_t *dflt, | ||
522 | unsigned int vcc, | ||
523 | void *priv_data) | ||
524 | { | 516 | { |
525 | int rc; | 517 | return pcmcia_request_io(p_dev); |
526 | if (!cfg->io.nwin) | ||
527 | return -ENODEV; | ||
528 | |||
529 | /* Get the IOaddr */ | ||
530 | p_dev->resource[0]->start = cfg->io.win[0].base; | ||
531 | p_dev->resource[0]->end = cfg->io.win[0].len; | ||
532 | p_dev->resource[0]->flags |= pcmcia_io_cfg_data_width(cfg->io.flags); | ||
533 | p_dev->io_lines = cfg->io.flags & CISTPL_IO_LINES_MASK; | ||
534 | rc = pcmcia_request_io(p_dev); | ||
535 | |||
536 | dev_printk(KERN_INFO, &p_dev->dev, | ||
537 | "pcmcia_request_io returned 0x%x\n", rc); | ||
538 | return rc; | ||
539 | } | 518 | } |
540 | 519 | ||
541 | 520 | ||
@@ -544,15 +523,15 @@ static int reader_config(struct pcmcia_device *link, int devno) | |||
544 | struct reader_dev *dev; | 523 | struct reader_dev *dev; |
545 | int fail_rc; | 524 | int fail_rc; |
546 | 525 | ||
526 | link->config_flags |= CONF_AUTO_SET_IO; | ||
527 | |||
547 | if (pcmcia_loop_config(link, cm4040_config_check, NULL)) | 528 | if (pcmcia_loop_config(link, cm4040_config_check, NULL)) |
548 | goto cs_release; | 529 | goto cs_release; |
549 | 530 | ||
550 | link->conf.IntType = 00000002; | 531 | fail_rc = pcmcia_enable_device(link); |
551 | |||
552 | fail_rc = pcmcia_request_configuration(link, &link->conf); | ||
553 | if (fail_rc != 0) { | 532 | if (fail_rc != 0) { |
554 | dev_printk(KERN_INFO, &link->dev, | 533 | dev_printk(KERN_INFO, &link->dev, |
555 | "pcmcia_request_configuration failed 0x%x\n", | 534 | "pcmcia_enable_device failed 0x%x\n", |
556 | fail_rc); | 535 | fail_rc); |
557 | goto cs_release; | 536 | goto cs_release; |
558 | } | 537 | } |
@@ -599,7 +578,6 @@ static int reader_probe(struct pcmcia_device *link) | |||
599 | link->priv = dev; | 578 | link->priv = dev; |
600 | dev->p_dev = link; | 579 | dev->p_dev = link; |
601 | 580 | ||
602 | link->conf.IntType = INT_MEMORY_AND_IO; | ||
603 | dev_table[i] = link; | 581 | dev_table[i] = link; |
604 | 582 | ||
605 | init_waitqueue_head(&dev->devq); | 583 | init_waitqueue_head(&dev->devq); |
@@ -662,9 +640,7 @@ MODULE_DEVICE_TABLE(pcmcia, cm4040_ids); | |||
662 | 640 | ||
663 | static struct pcmcia_driver reader_driver = { | 641 | static struct pcmcia_driver reader_driver = { |
664 | .owner = THIS_MODULE, | 642 | .owner = THIS_MODULE, |
665 | .drv = { | 643 | .name = "cm4040_cs", |
666 | .name = "cm4040_cs", | ||
667 | }, | ||
668 | .probe = reader_probe, | 644 | .probe = reader_probe, |
669 | .remove = reader_detach, | 645 | .remove = reader_detach, |
670 | .id_table = cm4040_ids, | 646 | .id_table = cm4040_ids, |
@@ -674,7 +650,6 @@ static int __init cm4040_init(void) | |||
674 | { | 650 | { |
675 | int rc; | 651 | int rc; |
676 | 652 | ||
677 | printk(KERN_INFO "%s\n", version); | ||
678 | cmx_class = class_create(THIS_MODULE, "cardman_4040"); | 653 | cmx_class = class_create(THIS_MODULE, "cardman_4040"); |
679 | if (IS_ERR(cmx_class)) | 654 | if (IS_ERR(cmx_class)) |
680 | return PTR_ERR(cmx_class); | 655 | return PTR_ERR(cmx_class); |
@@ -699,7 +674,6 @@ static int __init cm4040_init(void) | |||
699 | 674 | ||
700 | static void __exit cm4040_exit(void) | 675 | static void __exit cm4040_exit(void) |
701 | { | 676 | { |
702 | printk(KERN_INFO MODULE_NAME ": unloading\n"); | ||
703 | pcmcia_unregister_driver(&reader_driver); | 677 | pcmcia_unregister_driver(&reader_driver); |
704 | unregister_chrdev(major, DEVICE_NAME); | 678 | unregister_chrdev(major, DEVICE_NAME); |
705 | class_destroy(cmx_class); | 679 | class_destroy(cmx_class); |
diff --git a/drivers/char/pcmcia/ipwireless/main.c b/drivers/char/pcmcia/ipwireless/main.c index 67bdb05798b1..94b8eb4d691d 100644 --- a/drivers/char/pcmcia/ipwireless/main.c +++ b/drivers/char/pcmcia/ipwireless/main.c | |||
@@ -32,7 +32,6 @@ | |||
32 | #include <pcmcia/device_id.h> | 32 | #include <pcmcia/device_id.h> |
33 | #include <pcmcia/ss.h> | 33 | #include <pcmcia/ss.h> |
34 | #include <pcmcia/ds.h> | 34 | #include <pcmcia/ds.h> |
35 | #include <pcmcia/cs.h> | ||
36 | 35 | ||
37 | static struct pcmcia_device_id ipw_ids[] = { | 36 | static struct pcmcia_device_id ipw_ids[] = { |
38 | PCMCIA_DEVICE_MANF_CARD(0x02f2, 0x0100), | 37 | PCMCIA_DEVICE_MANF_CARD(0x02f2, 0x0100), |
@@ -76,23 +75,18 @@ static void signalled_reboot_callback(void *callback_data) | |||
76 | schedule_work(&ipw->work_reboot); | 75 | schedule_work(&ipw->work_reboot); |
77 | } | 76 | } |
78 | 77 | ||
79 | static int ipwireless_probe(struct pcmcia_device *p_dev, | 78 | static int ipwireless_probe(struct pcmcia_device *p_dev, void *priv_data) |
80 | cistpl_cftable_entry_t *cfg, | ||
81 | cistpl_cftable_entry_t *dflt, | ||
82 | unsigned int vcc, | ||
83 | void *priv_data) | ||
84 | { | 79 | { |
85 | struct ipw_dev *ipw = priv_data; | 80 | struct ipw_dev *ipw = priv_data; |
86 | struct resource *io_resource; | 81 | struct resource *io_resource; |
87 | int ret; | 82 | int ret; |
88 | 83 | ||
84 | p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH; | ||
89 | p_dev->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO; | 85 | p_dev->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO; |
90 | p_dev->resource[0]->start = cfg->io.win[0].base; | ||
91 | p_dev->resource[0]->end = cfg->io.win[0].len; | ||
92 | 86 | ||
93 | /* 0x40 causes it to generate level mode interrupts. */ | 87 | /* 0x40 causes it to generate level mode interrupts. */ |
94 | /* 0x04 enables IREQ pin. */ | 88 | /* 0x04 enables IREQ pin. */ |
95 | p_dev->conf.ConfigIndex = cfg->index | 0x44; | 89 | p_dev->config_index |= 0x44; |
96 | p_dev->io_lines = 16; | 90 | p_dev->io_lines = 16; |
97 | ret = pcmcia_request_io(p_dev); | 91 | ret = pcmcia_request_io(p_dev); |
98 | if (ret) | 92 | if (ret) |
@@ -102,65 +96,49 @@ static int ipwireless_probe(struct pcmcia_device *p_dev, | |||
102 | resource_size(p_dev->resource[0]), | 96 | resource_size(p_dev->resource[0]), |
103 | IPWIRELESS_PCCARD_NAME); | 97 | IPWIRELESS_PCCARD_NAME); |
104 | 98 | ||
105 | if (cfg->mem.nwin == 0) | 99 | p_dev->resource[2]->flags |= |
106 | return 0; | ||
107 | |||
108 | ipw->request_common_memory.Attributes = | ||
109 | WIN_DATA_WIDTH_16 | WIN_MEMORY_TYPE_CM | WIN_ENABLE; | 100 | WIN_DATA_WIDTH_16 | WIN_MEMORY_TYPE_CM | WIN_ENABLE; |
110 | ipw->request_common_memory.Base = cfg->mem.win[0].host_addr; | ||
111 | ipw->request_common_memory.Size = cfg->mem.win[0].len; | ||
112 | if (ipw->request_common_memory.Size < 0x1000) | ||
113 | ipw->request_common_memory.Size = 0x1000; | ||
114 | ipw->request_common_memory.AccessSpeed = 0; | ||
115 | |||
116 | ret = pcmcia_request_window(p_dev, &ipw->request_common_memory, | ||
117 | &ipw->handle_common_memory); | ||
118 | 101 | ||
102 | ret = pcmcia_request_window(p_dev, p_dev->resource[2], 0); | ||
119 | if (ret != 0) | 103 | if (ret != 0) |
120 | goto exit1; | 104 | goto exit1; |
121 | 105 | ||
122 | ret = pcmcia_map_mem_page(p_dev, ipw->handle_common_memory, | 106 | ret = pcmcia_map_mem_page(p_dev, p_dev->resource[2], p_dev->card_addr); |
123 | cfg->mem.win[0].card_addr); | ||
124 | |||
125 | if (ret != 0) | 107 | if (ret != 0) |
126 | goto exit2; | 108 | goto exit2; |
127 | 109 | ||
128 | ipw->is_v2_card = cfg->mem.win[0].len == 0x100; | 110 | ipw->is_v2_card = resource_size(p_dev->resource[2]) == 0x100; |
129 | 111 | ||
130 | ipw->common_memory = ioremap(ipw->request_common_memory.Base, | 112 | ipw->attr_memory = ioremap(p_dev->resource[2]->start, |
131 | ipw->request_common_memory.Size); | 113 | resource_size(p_dev->resource[2])); |
132 | request_mem_region(ipw->request_common_memory.Base, | 114 | request_mem_region(p_dev->resource[2]->start, |
133 | ipw->request_common_memory.Size, | 115 | resource_size(p_dev->resource[2]), |
134 | IPWIRELESS_PCCARD_NAME); | 116 | IPWIRELESS_PCCARD_NAME); |
135 | 117 | ||
136 | ipw->request_attr_memory.Attributes = | 118 | p_dev->resource[3]->flags |= WIN_DATA_WIDTH_16 | WIN_MEMORY_TYPE_AM | |
137 | WIN_DATA_WIDTH_16 | WIN_MEMORY_TYPE_AM | WIN_ENABLE; | 119 | WIN_ENABLE; |
138 | ipw->request_attr_memory.Base = 0; | 120 | p_dev->resource[3]->end = 0; /* this used to be 0x1000 */ |
139 | ipw->request_attr_memory.Size = 0; /* this used to be 0x1000 */ | 121 | ret = pcmcia_request_window(p_dev, p_dev->resource[3], 0); |
140 | ipw->request_attr_memory.AccessSpeed = 0; | ||
141 | |||
142 | ret = pcmcia_request_window(p_dev, &ipw->request_attr_memory, | ||
143 | &ipw->handle_attr_memory); | ||
144 | |||
145 | if (ret != 0) | 122 | if (ret != 0) |
146 | goto exit2; | 123 | goto exit2; |
147 | 124 | ||
148 | ret = pcmcia_map_mem_page(p_dev, ipw->handle_attr_memory, 0); | 125 | ret = pcmcia_map_mem_page(p_dev, p_dev->resource[3], 0); |
149 | if (ret != 0) | 126 | if (ret != 0) |
150 | goto exit3; | 127 | goto exit3; |
151 | 128 | ||
152 | ipw->attr_memory = ioremap(ipw->request_attr_memory.Base, | 129 | ipw->attr_memory = ioremap(p_dev->resource[3]->start, |
153 | ipw->request_attr_memory.Size); | 130 | resource_size(p_dev->resource[3])); |
154 | request_mem_region(ipw->request_attr_memory.Base, | 131 | request_mem_region(p_dev->resource[3]->start, |
155 | ipw->request_attr_memory.Size, IPWIRELESS_PCCARD_NAME); | 132 | resource_size(p_dev->resource[3]), |
133 | IPWIRELESS_PCCARD_NAME); | ||
156 | 134 | ||
157 | return 0; | 135 | return 0; |
158 | 136 | ||
159 | exit3: | 137 | exit3: |
160 | exit2: | 138 | exit2: |
161 | if (ipw->common_memory) { | 139 | if (ipw->common_memory) { |
162 | release_mem_region(ipw->request_common_memory.Base, | 140 | release_mem_region(p_dev->resource[2]->start, |
163 | ipw->request_common_memory.Size); | 141 | resource_size(p_dev->resource[2])); |
164 | iounmap(ipw->common_memory); | 142 | iounmap(ipw->common_memory); |
165 | } | 143 | } |
166 | exit1: | 144 | exit1: |
@@ -175,14 +153,13 @@ static int config_ipwireless(struct ipw_dev *ipw) | |||
175 | int ret = 0; | 153 | int ret = 0; |
176 | 154 | ||
177 | 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; | ||
178 | 158 | ||
179 | ret = pcmcia_loop_config(link, ipwireless_probe, ipw); | 159 | ret = pcmcia_loop_config(link, ipwireless_probe, ipw); |
180 | if (ret != 0) | 160 | if (ret != 0) |
181 | return ret; | 161 | return ret; |
182 | 162 | ||
183 | link->conf.Attributes = CONF_ENABLE_IRQ; | ||
184 | link->conf.IntType = INT_MEMORY_AND_IO; | ||
185 | |||
186 | INIT_WORK(&ipw->work_reboot, signalled_reboot_work); | 163 | INIT_WORK(&ipw->work_reboot, signalled_reboot_work); |
187 | 164 | ||
188 | ipwireless_init_hardware_v1(ipw->hardware, link->resource[0]->start, | 165 | ipwireless_init_hardware_v1(ipw->hardware, link->resource[0]->start, |
@@ -201,13 +178,9 @@ static int config_ipwireless(struct ipw_dev *ipw) | |||
201 | (unsigned int) link->irq); | 178 | (unsigned int) link->irq); |
202 | if (ipw->attr_memory && ipw->common_memory) | 179 | if (ipw->attr_memory && ipw->common_memory) |
203 | printk(KERN_INFO IPWIRELESS_PCCARD_NAME | 180 | printk(KERN_INFO IPWIRELESS_PCCARD_NAME |
204 | ": attr memory 0x%08lx-0x%08lx, common memory 0x%08lx-0x%08lx\n", | 181 | ": attr memory %pR, common memory %pR\n", |
205 | ipw->request_attr_memory.Base, | 182 | link->resource[3], |
206 | ipw->request_attr_memory.Base | 183 | link->resource[2]); |
207 | + ipw->request_attr_memory.Size - 1, | ||
208 | ipw->request_common_memory.Base, | ||
209 | ipw->request_common_memory.Base | ||
210 | + ipw->request_common_memory.Size - 1); | ||
211 | 184 | ||
212 | ipw->network = ipwireless_network_create(ipw->hardware); | 185 | ipw->network = ipwireless_network_create(ipw->hardware); |
213 | if (!ipw->network) | 186 | if (!ipw->network) |
@@ -223,25 +196,23 @@ static int config_ipwireless(struct ipw_dev *ipw) | |||
223 | * Do the RequestConfiguration last, because it enables interrupts. | 196 | * Do the RequestConfiguration last, because it enables interrupts. |
224 | * Then we don't get any interrupts before we're ready for them. | 197 | * Then we don't get any interrupts before we're ready for them. |
225 | */ | 198 | */ |
226 | ret = pcmcia_request_configuration(link, &link->conf); | 199 | ret = pcmcia_enable_device(link); |
227 | |||
228 | if (ret != 0) | 200 | if (ret != 0) |
229 | goto exit; | 201 | goto exit; |
230 | 202 | ||
231 | return 0; | 203 | return 0; |
232 | 204 | ||
233 | exit: | 205 | exit: |
234 | if (ipw->attr_memory) { | ||
235 | release_mem_region(ipw->request_attr_memory.Base, | ||
236 | ipw->request_attr_memory.Size); | ||
237 | iounmap(ipw->attr_memory); | ||
238 | |||
239 | } | ||
240 | if (ipw->common_memory) { | 206 | if (ipw->common_memory) { |
241 | release_mem_region(ipw->request_common_memory.Base, | 207 | release_mem_region(link->resource[2]->start, |
242 | ipw->request_common_memory.Size); | 208 | resource_size(link->resource[2])); |
243 | iounmap(ipw->common_memory); | 209 | iounmap(ipw->common_memory); |
244 | } | 210 | } |
211 | if (ipw->attr_memory) { | ||
212 | release_mem_region(link->resource[3]->start, | ||
213 | resource_size(link->resource[3])); | ||
214 | iounmap(ipw->attr_memory); | ||
215 | } | ||
245 | pcmcia_disable_device(link); | 216 | pcmcia_disable_device(link); |
246 | return -1; | 217 | return -1; |
247 | } | 218 | } |
@@ -249,13 +220,13 @@ exit: | |||
249 | static void release_ipwireless(struct ipw_dev *ipw) | 220 | static void release_ipwireless(struct ipw_dev *ipw) |
250 | { | 221 | { |
251 | if (ipw->common_memory) { | 222 | if (ipw->common_memory) { |
252 | release_mem_region(ipw->request_common_memory.Base, | 223 | release_mem_region(ipw->link->resource[2]->start, |
253 | ipw->request_common_memory.Size); | 224 | resource_size(ipw->link->resource[2])); |
254 | iounmap(ipw->common_memory); | 225 | iounmap(ipw->common_memory); |
255 | } | 226 | } |
256 | if (ipw->attr_memory) { | 227 | if (ipw->attr_memory) { |
257 | release_mem_region(ipw->request_attr_memory.Base, | 228 | release_mem_region(ipw->link->resource[3]->start, |
258 | ipw->request_attr_memory.Size); | 229 | resource_size(ipw->link->resource[3])); |
259 | iounmap(ipw->attr_memory); | 230 | iounmap(ipw->attr_memory); |
260 | } | 231 | } |
261 | pcmcia_disable_device(ipw->link); | 232 | pcmcia_disable_device(ipw->link); |
@@ -324,7 +295,7 @@ static struct pcmcia_driver me = { | |||
324 | .owner = THIS_MODULE, | 295 | .owner = THIS_MODULE, |
325 | .probe = ipwireless_attach, | 296 | .probe = ipwireless_attach, |
326 | .remove = ipwireless_detach, | 297 | .remove = ipwireless_detach, |
327 | .drv = { .name = IPWIRELESS_PCCARD_NAME }, | 298 | .name = IPWIRELESS_PCCARD_NAME, |
328 | .id_table = ipw_ids | 299 | .id_table = ipw_ids |
329 | }; | 300 | }; |
330 | 301 | ||
@@ -336,9 +307,6 @@ static int __init init_ipwireless(void) | |||
336 | { | 307 | { |
337 | int ret; | 308 | int ret; |
338 | 309 | ||
339 | printk(KERN_INFO IPWIRELESS_PCCARD_NAME " " | ||
340 | IPWIRELESS_PCMCIA_VERSION " by " IPWIRELESS_PCMCIA_AUTHOR "\n"); | ||
341 | |||
342 | ret = ipwireless_tty_init(); | 310 | ret = ipwireless_tty_init(); |
343 | if (ret != 0) | 311 | if (ret != 0) |
344 | return ret; | 312 | return ret; |
@@ -355,9 +323,6 @@ static int __init init_ipwireless(void) | |||
355 | */ | 323 | */ |
356 | static void __exit exit_ipwireless(void) | 324 | static void __exit exit_ipwireless(void) |
357 | { | 325 | { |
358 | printk(KERN_INFO IPWIRELESS_PCCARD_NAME " " | ||
359 | IPWIRELESS_PCMCIA_VERSION " removed\n"); | ||
360 | |||
361 | pcmcia_unregister_driver(&me); | 326 | pcmcia_unregister_driver(&me); |
362 | ipwireless_tty_release(); | 327 | ipwireless_tty_release(); |
363 | } | 328 | } |
diff --git a/drivers/char/pcmcia/ipwireless/main.h b/drivers/char/pcmcia/ipwireless/main.h index c207be87b597..f2cbb116bccb 100644 --- a/drivers/char/pcmcia/ipwireless/main.h +++ b/drivers/char/pcmcia/ipwireless/main.h | |||
@@ -21,7 +21,6 @@ | |||
21 | #include <linux/sched.h> | 21 | #include <linux/sched.h> |
22 | #include <linux/types.h> | 22 | #include <linux/types.h> |
23 | 23 | ||
24 | #include <pcmcia/cs.h> | ||
25 | #include <pcmcia/cistpl.h> | 24 | #include <pcmcia/cistpl.h> |
26 | #include <pcmcia/ds.h> | 25 | #include <pcmcia/ds.h> |
27 | 26 | ||
@@ -45,13 +44,9 @@ struct ipw_dev { | |||
45 | struct pcmcia_device *link; | 44 | struct pcmcia_device *link; |
46 | int is_v2_card; | 45 | int is_v2_card; |
47 | 46 | ||
48 | window_handle_t handle_attr_memory; | ||
49 | void __iomem *attr_memory; | 47 | void __iomem *attr_memory; |
50 | win_req_t request_attr_memory; | ||
51 | 48 | ||
52 | window_handle_t handle_common_memory; | ||
53 | void __iomem *common_memory; | 49 | void __iomem *common_memory; |
54 | win_req_t request_common_memory; | ||
55 | 50 | ||
56 | /* Reference to attribute memory, containing CIS data */ | 51 | /* Reference to attribute memory, containing CIS data */ |
57 | void *attribute_memory; | 52 | void *attribute_memory; |
diff --git a/drivers/char/pcmcia/ipwireless/tty.h b/drivers/char/pcmcia/ipwireless/tty.h index 3e163d4cab15..747b2d637860 100644 --- a/drivers/char/pcmcia/ipwireless/tty.h +++ b/drivers/char/pcmcia/ipwireless/tty.h | |||
@@ -21,7 +21,6 @@ | |||
21 | #include <linux/types.h> | 21 | #include <linux/types.h> |
22 | #include <linux/sched.h> | 22 | #include <linux/sched.h> |
23 | 23 | ||
24 | #include <pcmcia/cs.h> | ||
25 | #include <pcmcia/cistpl.h> | 24 | #include <pcmcia/cistpl.h> |
26 | #include <pcmcia/ds.h> | 25 | #include <pcmcia/ds.h> |
27 | 26 | ||
diff --git a/drivers/char/pcmcia/synclink_cs.c b/drivers/char/pcmcia/synclink_cs.c index 9ecd6bef5d3b..be1810057607 100644 --- a/drivers/char/pcmcia/synclink_cs.c +++ b/drivers/char/pcmcia/synclink_cs.c | |||
@@ -70,7 +70,6 @@ | |||
70 | #include <linux/workqueue.h> | 70 | #include <linux/workqueue.h> |
71 | #include <linux/hdlc.h> | 71 | #include <linux/hdlc.h> |
72 | 72 | ||
73 | #include <pcmcia/cs.h> | ||
74 | #include <pcmcia/cistpl.h> | 73 | #include <pcmcia/cistpl.h> |
75 | #include <pcmcia/cisreg.h> | 74 | #include <pcmcia/cisreg.h> |
76 | #include <pcmcia/ds.h> | 75 | #include <pcmcia/ds.h> |
@@ -550,9 +549,6 @@ static int mgslpc_probe(struct pcmcia_device *link) | |||
550 | 549 | ||
551 | /* Initialize the struct pcmcia_device structure */ | 550 | /* Initialize the struct pcmcia_device structure */ |
552 | 551 | ||
553 | link->conf.Attributes = 0; | ||
554 | link->conf.IntType = INT_MEMORY_AND_IO; | ||
555 | |||
556 | ret = mgslpc_config(link); | 552 | ret = mgslpc_config(link); |
557 | if (ret) | 553 | if (ret) |
558 | return ret; | 554 | return ret; |
@@ -565,20 +561,8 @@ static int mgslpc_probe(struct pcmcia_device *link) | |||
565 | /* Card has been inserted. | 561 | /* Card has been inserted. |
566 | */ | 562 | */ |
567 | 563 | ||
568 | static int mgslpc_ioprobe(struct pcmcia_device *p_dev, | 564 | static int mgslpc_ioprobe(struct pcmcia_device *p_dev, void *priv_data) |
569 | cistpl_cftable_entry_t *cfg, | ||
570 | cistpl_cftable_entry_t *dflt, | ||
571 | unsigned int vcc, | ||
572 | void *priv_data) | ||
573 | { | 565 | { |
574 | if (!cfg->io.nwin) | ||
575 | return -ENODEV; | ||
576 | |||
577 | p_dev->resource[0]->start = cfg->io.win[0].base; | ||
578 | p_dev->resource[0]->end = cfg->io.win[0].len; | ||
579 | p_dev->resource[0]->flags |= pcmcia_io_cfg_data_width(cfg->io.flags); | ||
580 | p_dev->io_lines = cfg->io.flags & CISTPL_IO_LINES_MASK; | ||
581 | |||
582 | return pcmcia_request_io(p_dev); | 566 | return pcmcia_request_io(p_dev); |
583 | } | 567 | } |
584 | 568 | ||
@@ -590,32 +574,24 @@ static int mgslpc_config(struct pcmcia_device *link) | |||
590 | if (debug_level >= DEBUG_LEVEL_INFO) | 574 | if (debug_level >= DEBUG_LEVEL_INFO) |
591 | printk("mgslpc_config(0x%p)\n", link); | 575 | printk("mgslpc_config(0x%p)\n", link); |
592 | 576 | ||
577 | link->config_flags |= CONF_ENABLE_IRQ | CONF_AUTO_SET_IO; | ||
578 | |||
593 | ret = pcmcia_loop_config(link, mgslpc_ioprobe, NULL); | 579 | ret = pcmcia_loop_config(link, mgslpc_ioprobe, NULL); |
594 | if (ret != 0) | 580 | if (ret != 0) |
595 | goto failed; | 581 | goto failed; |
596 | 582 | ||
597 | link->conf.Attributes = CONF_ENABLE_IRQ; | 583 | link->config_index = 8; |
598 | link->conf.IntType = INT_MEMORY_AND_IO; | 584 | link->config_regs = PRESENT_OPTION; |
599 | link->conf.ConfigIndex = 8; | ||
600 | link->conf.Present = PRESENT_OPTION; | ||
601 | 585 | ||
602 | ret = pcmcia_request_irq(link, mgslpc_isr); | 586 | ret = pcmcia_request_irq(link, mgslpc_isr); |
603 | if (ret) | 587 | if (ret) |
604 | goto failed; | 588 | goto failed; |
605 | ret = pcmcia_request_configuration(link, &link->conf); | 589 | ret = pcmcia_enable_device(link); |
606 | if (ret) | 590 | if (ret) |
607 | goto failed; | 591 | goto failed; |
608 | 592 | ||
609 | info->io_base = link->resource[0]->start; | 593 | info->io_base = link->resource[0]->start; |
610 | info->irq_level = link->irq; | 594 | info->irq_level = link->irq; |
611 | |||
612 | dev_info(&link->dev, "index 0x%02x:", | ||
613 | link->conf.ConfigIndex); | ||
614 | if (link->conf.Attributes & CONF_ENABLE_IRQ) | ||
615 | printk(", irq %d", link->irq); | ||
616 | if (link->resource[0]) | ||
617 | printk(", io %pR", link->resource[0]); | ||
618 | printk("\n"); | ||
619 | return 0; | 595 | return 0; |
620 | 596 | ||
621 | failed: | 597 | failed: |
@@ -2797,9 +2773,7 @@ MODULE_DEVICE_TABLE(pcmcia, mgslpc_ids); | |||
2797 | 2773 | ||
2798 | static struct pcmcia_driver mgslpc_driver = { | 2774 | static struct pcmcia_driver mgslpc_driver = { |
2799 | .owner = THIS_MODULE, | 2775 | .owner = THIS_MODULE, |
2800 | .drv = { | 2776 | .name = "synclink_cs", |
2801 | .name = "synclink_cs", | ||
2802 | }, | ||
2803 | .probe = mgslpc_probe, | 2777 | .probe = mgslpc_probe, |
2804 | .remove = mgslpc_detach, | 2778 | .remove = mgslpc_detach, |
2805 | .id_table = mgslpc_ids, | 2779 | .id_table = mgslpc_ids, |
@@ -2835,8 +2809,6 @@ static void synclink_cs_cleanup(void) | |||
2835 | { | 2809 | { |
2836 | int rc; | 2810 | int rc; |
2837 | 2811 | ||
2838 | printk("Unloading %s: version %s\n", driver_name, driver_version); | ||
2839 | |||
2840 | while(mgslpc_device_list) | 2812 | while(mgslpc_device_list) |
2841 | mgslpc_remove_device(mgslpc_device_list); | 2813 | mgslpc_remove_device(mgslpc_device_list); |
2842 | 2814 | ||
@@ -2859,8 +2831,6 @@ static int __init synclink_cs_init(void) | |||
2859 | BREAKPOINT(); | 2831 | BREAKPOINT(); |
2860 | } | 2832 | } |
2861 | 2833 | ||
2862 | printk("%s %s\n", driver_name, driver_version); | ||
2863 | |||
2864 | if ((rc = pcmcia_register_driver(&mgslpc_driver)) < 0) | 2834 | if ((rc = pcmcia_register_driver(&mgslpc_driver)) < 0) |
2865 | return rc; | 2835 | return rc; |
2866 | 2836 | ||
@@ -4127,6 +4097,8 @@ static int hdlcdev_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) | |||
4127 | if (cmd != SIOCWANDEV) | 4097 | if (cmd != SIOCWANDEV) |
4128 | return hdlc_ioctl(dev, ifr, cmd); | 4098 | return hdlc_ioctl(dev, ifr, cmd); |
4129 | 4099 | ||
4100 | memset(&new_line, 0, size); | ||
4101 | |||
4130 | switch(ifr->ifr_settings.type) { | 4102 | switch(ifr->ifr_settings.type) { |
4131 | case IF_GET_IFACE: /* return current sync_serial_settings */ | 4103 | case IF_GET_IFACE: /* return current sync_serial_settings */ |
4132 | 4104 | ||