diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-05 12:42:59 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-12-05 12:42:59 -0500 |
commit | d9b2c4d0b03c721808c0d259e43a27f1e80205bc (patch) | |
tree | f17a4166f62ee14faa1401a6cbd353a4ab8c77cb /drivers/net/wireless/libertas | |
parent | 27d16d08717faeaa8afd1b736a096dbaab90f08e (diff) | |
parent | 5fa9167a1bf5f5a4b7282f5e7ac56a4a5a1fa044 (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: (50 commits)
pcmcia: rework the irq_req_t typedef
pcmcia: remove deprecated handle_to_dev() macro
pcmcia: pcmcia_request_window() doesn't need a pointer to a pointer
pcmcia: remove unused "window_t" typedef
pcmcia: move some window-related code to pcmcia_ioctl.c
pcmcia: Change window_handle_t logic to unsigned long
pcmcia: Pass struct pcmcia_socket to pcmcia_get_mem_page()
pcmcia: Pass struct pcmcia_device to pcmcia_map_mem_page()
pcmcia: Pass struct pcmcia_device to pcmcia_release_window()
drivers/pcmcia: remove unnecessary kzalloc
pcmcia: correct handling for Zoomed Video registers in topic.h
pcmcia: fix printk formats
pcmcia: autoload module pcmcia
pcmcia/staging: update comedi drivers
PCMCIA: stop duplicating pci_irq in soc_pcmcia_socket
PCMCIA: ss: allow PCI IRQs > 255
PCMCIA: soc_common: remove 'dev' member from soc_pcmcia_socket
PCMCIA: soc_common: constify soc_pcmcia_socket ops member
PCMCIA: sa1111: remove duplicated initializers
PCMCIA: sa1111: wrap soc_pcmcia_socket to contain sa1111 specific data
...
Diffstat (limited to 'drivers/net/wireless/libertas')
-rw-r--r-- | drivers/net/wireless/libertas/if_cs.c | 72 |
1 files changed, 29 insertions, 43 deletions
diff --git a/drivers/net/wireless/libertas/if_cs.c b/drivers/net/wireless/libertas/if_cs.c index 62381768f2d5..b1d84592b959 100644 --- a/drivers/net/wireless/libertas/if_cs.c +++ b/drivers/net/wireless/libertas/if_cs.c | |||
@@ -590,7 +590,7 @@ static int if_cs_prog_helper(struct if_cs_card *card) | |||
590 | 590 | ||
591 | /* TODO: make firmware file configurable */ | 591 | /* TODO: make firmware file configurable */ |
592 | ret = request_firmware(&fw, "libertas_cs_helper.fw", | 592 | ret = request_firmware(&fw, "libertas_cs_helper.fw", |
593 | &handle_to_dev(card->p_dev)); | 593 | &card->p_dev->dev); |
594 | if (ret) { | 594 | if (ret) { |
595 | lbs_pr_err("can't load helper firmware\n"); | 595 | lbs_pr_err("can't load helper firmware\n"); |
596 | ret = -ENODEV; | 596 | ret = -ENODEV; |
@@ -663,7 +663,7 @@ static int if_cs_prog_real(struct if_cs_card *card) | |||
663 | 663 | ||
664 | /* TODO: make firmware file configurable */ | 664 | /* TODO: make firmware file configurable */ |
665 | ret = request_firmware(&fw, "libertas_cs.fw", | 665 | ret = request_firmware(&fw, "libertas_cs.fw", |
666 | &handle_to_dev(card->p_dev)); | 666 | &card->p_dev->dev); |
667 | if (ret) { | 667 | if (ret) { |
668 | lbs_pr_err("can't load firmware\n"); | 668 | lbs_pr_err("can't load firmware\n"); |
669 | ret = -ENODEV; | 669 | ret = -ENODEV; |
@@ -793,18 +793,37 @@ static void if_cs_release(struct pcmcia_device *p_dev) | |||
793 | * configure the card at this point -- we wait until we receive a card | 793 | * configure the card at this point -- we wait until we receive a card |
794 | * insertion event. | 794 | * insertion event. |
795 | */ | 795 | */ |
796 | |||
797 | static int if_cs_ioprobe(struct pcmcia_device *p_dev, | ||
798 | cistpl_cftable_entry_t *cfg, | ||
799 | cistpl_cftable_entry_t *dflt, | ||
800 | unsigned int vcc, | ||
801 | void *priv_data) | ||
802 | { | ||
803 | p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; | ||
804 | p_dev->io.BasePort1 = cfg->io.win[0].base; | ||
805 | p_dev->io.NumPorts1 = cfg->io.win[0].len; | ||
806 | |||
807 | /* Do we need to allocate an interrupt? */ | ||
808 | if (cfg->irq.IRQInfo1) | ||
809 | p_dev->conf.Attributes |= CONF_ENABLE_IRQ; | ||
810 | |||
811 | /* IO window settings */ | ||
812 | if (cfg->io.nwin != 1) { | ||
813 | lbs_pr_err("wrong CIS (check number of IO windows)\n"); | ||
814 | return -ENODEV; | ||
815 | } | ||
816 | |||
817 | /* This reserves IO space but doesn't actually enable it */ | ||
818 | return pcmcia_request_io(p_dev, &p_dev->io); | ||
819 | } | ||
820 | |||
796 | static int if_cs_probe(struct pcmcia_device *p_dev) | 821 | static int if_cs_probe(struct pcmcia_device *p_dev) |
797 | { | 822 | { |
798 | int ret = -ENOMEM; | 823 | int ret = -ENOMEM; |
799 | unsigned int prod_id; | 824 | unsigned int prod_id; |
800 | struct lbs_private *priv; | 825 | struct lbs_private *priv; |
801 | struct if_cs_card *card; | 826 | struct if_cs_card *card; |
802 | /* CIS parsing */ | ||
803 | tuple_t tuple; | ||
804 | cisparse_t parse; | ||
805 | cistpl_cftable_entry_t *cfg = &parse.cftable_entry; | ||
806 | cistpl_io_t *io = &cfg->io; | ||
807 | u_char buf[64]; | ||
808 | 827 | ||
809 | lbs_deb_enter(LBS_DEB_CS); | 828 | lbs_deb_enter(LBS_DEB_CS); |
810 | 829 | ||
@@ -818,48 +837,15 @@ static int if_cs_probe(struct pcmcia_device *p_dev) | |||
818 | 837 | ||
819 | p_dev->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING; | 838 | p_dev->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING; |
820 | p_dev->irq.Handler = NULL; | 839 | p_dev->irq.Handler = NULL; |
821 | p_dev->irq.IRQInfo1 = IRQ_INFO2_VALID | IRQ_LEVEL_ID; | ||
822 | 840 | ||
823 | p_dev->conf.Attributes = 0; | 841 | p_dev->conf.Attributes = 0; |
824 | p_dev->conf.IntType = INT_MEMORY_AND_IO; | 842 | p_dev->conf.IntType = INT_MEMORY_AND_IO; |
825 | 843 | ||
826 | tuple.Attributes = 0; | 844 | if (pcmcia_loop_config(p_dev, if_cs_ioprobe, NULL)) { |
827 | tuple.TupleData = buf; | 845 | lbs_pr_err("error in pcmcia_loop_config\n"); |
828 | tuple.TupleDataMax = sizeof(buf); | ||
829 | tuple.TupleOffset = 0; | ||
830 | |||
831 | tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; | ||
832 | if ((ret = pcmcia_get_first_tuple(p_dev, &tuple)) != 0 || | ||
833 | (ret = pcmcia_get_tuple_data(p_dev, &tuple)) != 0 || | ||
834 | (ret = pcmcia_parse_tuple(&tuple, &parse)) != 0) | ||
835 | { | ||
836 | lbs_pr_err("error in pcmcia_get_first_tuple etc\n"); | ||
837 | goto out1; | ||
838 | } | ||
839 | |||
840 | p_dev->conf.ConfigIndex = cfg->index; | ||
841 | |||
842 | /* Do we need to allocate an interrupt? */ | ||
843 | if (cfg->irq.IRQInfo1) { | ||
844 | p_dev->conf.Attributes |= CONF_ENABLE_IRQ; | ||
845 | } | ||
846 | |||
847 | /* IO window settings */ | ||
848 | if (cfg->io.nwin != 1) { | ||
849 | lbs_pr_err("wrong CIS (check number of IO windows)\n"); | ||
850 | ret = -ENODEV; | ||
851 | goto out1; | 846 | goto out1; |
852 | } | 847 | } |
853 | p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO; | ||
854 | p_dev->io.BasePort1 = io->win[0].base; | ||
855 | p_dev->io.NumPorts1 = io->win[0].len; | ||
856 | 848 | ||
857 | /* This reserves IO space but doesn't actually enable it */ | ||
858 | ret = pcmcia_request_io(p_dev, &p_dev->io); | ||
859 | if (ret) { | ||
860 | lbs_pr_err("error in pcmcia_request_io\n"); | ||
861 | goto out1; | ||
862 | } | ||
863 | 849 | ||
864 | /* | 850 | /* |
865 | * Allocate an interrupt line. Note that this does not assign | 851 | * Allocate an interrupt line. Note that this does not assign |