aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/libertas
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2009-12-05 18:22:26 -0500
committerDavid S. Miller <davem@davemloft.net>2009-12-05 18:22:26 -0500
commit28b4d5cc17c20786848cdc07b7ea237a309776bb (patch)
treebae406a4b17229dcce7c11be5073f7a67665e477 /drivers/net/wireless/libertas
parentd29cecda036f251aee4947f47eea0fe9ed8cc931 (diff)
parent96fa2b508d2d3fe040cf4ef2fffb955f0a537ea1 (diff)
Merge branch 'master' of /home/davem/src/GIT/linux-2.6/
Conflicts: drivers/net/pcmcia/fmvj18x_cs.c drivers/net/pcmcia/nmclan_cs.c drivers/net/pcmcia/xirc2ps_cs.c drivers/net/wireless/ray_cs.c
Diffstat (limited to 'drivers/net/wireless/libertas')
-rw-r--r--drivers/net/wireless/libertas/if_cs.c72
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 875516db319c..1f6cb58dd66c 100644
--- a/drivers/net/wireless/libertas/if_cs.c
+++ b/drivers/net/wireless/libertas/if_cs.c
@@ -591,7 +591,7 @@ static int if_cs_prog_helper(struct if_cs_card *card)
591 591
592 /* TODO: make firmware file configurable */ 592 /* TODO: make firmware file configurable */
593 ret = request_firmware(&fw, "libertas_cs_helper.fw", 593 ret = request_firmware(&fw, "libertas_cs_helper.fw",
594 &handle_to_dev(card->p_dev)); 594 &card->p_dev->dev);
595 if (ret) { 595 if (ret) {
596 lbs_pr_err("can't load helper firmware\n"); 596 lbs_pr_err("can't load helper firmware\n");
597 ret = -ENODEV; 597 ret = -ENODEV;
@@ -664,7 +664,7 @@ static int if_cs_prog_real(struct if_cs_card *card)
664 664
665 /* TODO: make firmware file configurable */ 665 /* TODO: make firmware file configurable */
666 ret = request_firmware(&fw, "libertas_cs.fw", 666 ret = request_firmware(&fw, "libertas_cs.fw",
667 &handle_to_dev(card->p_dev)); 667 &card->p_dev->dev);
668 if (ret) { 668 if (ret) {
669 lbs_pr_err("can't load firmware\n"); 669 lbs_pr_err("can't load firmware\n");
670 ret = -ENODEV; 670 ret = -ENODEV;
@@ -794,18 +794,37 @@ static void if_cs_release(struct pcmcia_device *p_dev)
794 * configure the card at this point -- we wait until we receive a card 794 * configure the card at this point -- we wait until we receive a card
795 * insertion event. 795 * insertion event.
796 */ 796 */
797
798static int if_cs_ioprobe(struct pcmcia_device *p_dev,
799 cistpl_cftable_entry_t *cfg,
800 cistpl_cftable_entry_t *dflt,
801 unsigned int vcc,
802 void *priv_data)
803{
804 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
805 p_dev->io.BasePort1 = cfg->io.win[0].base;
806 p_dev->io.NumPorts1 = cfg->io.win[0].len;
807
808 /* Do we need to allocate an interrupt? */
809 if (cfg->irq.IRQInfo1)
810 p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
811
812 /* IO window settings */
813 if (cfg->io.nwin != 1) {
814 lbs_pr_err("wrong CIS (check number of IO windows)\n");
815 return -ENODEV;
816 }
817
818 /* This reserves IO space but doesn't actually enable it */
819 return pcmcia_request_io(p_dev, &p_dev->io);
820}
821
797static int if_cs_probe(struct pcmcia_device *p_dev) 822static int if_cs_probe(struct pcmcia_device *p_dev)
798{ 823{
799 int ret = -ENOMEM; 824 int ret = -ENOMEM;
800 unsigned int prod_id; 825 unsigned int prod_id;
801 struct lbs_private *priv; 826 struct lbs_private *priv;
802 struct if_cs_card *card; 827 struct if_cs_card *card;
803 /* CIS parsing */
804 tuple_t tuple;
805 cisparse_t parse;
806 cistpl_cftable_entry_t *cfg = &parse.cftable_entry;
807 cistpl_io_t *io = &cfg->io;
808 u_char buf[64];
809 828
810 lbs_deb_enter(LBS_DEB_CS); 829 lbs_deb_enter(LBS_DEB_CS);
811 830
@@ -819,48 +838,15 @@ static int if_cs_probe(struct pcmcia_device *p_dev)
819 838
820 p_dev->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING; 839 p_dev->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
821 p_dev->irq.Handler = NULL; 840 p_dev->irq.Handler = NULL;
822 p_dev->irq.IRQInfo1 = IRQ_INFO2_VALID | IRQ_LEVEL_ID;
823 841
824 p_dev->conf.Attributes = 0; 842 p_dev->conf.Attributes = 0;
825 p_dev->conf.IntType = INT_MEMORY_AND_IO; 843 p_dev->conf.IntType = INT_MEMORY_AND_IO;
826 844
827 tuple.Attributes = 0; 845 if (pcmcia_loop_config(p_dev, if_cs_ioprobe, NULL)) {
828 tuple.TupleData = buf; 846 lbs_pr_err("error in pcmcia_loop_config\n");
829 tuple.TupleDataMax = sizeof(buf);
830 tuple.TupleOffset = 0;
831
832 tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY;
833 if ((ret = pcmcia_get_first_tuple(p_dev, &tuple)) != 0 ||
834 (ret = pcmcia_get_tuple_data(p_dev, &tuple)) != 0 ||
835 (ret = pcmcia_parse_tuple(&tuple, &parse)) != 0)
836 {
837 lbs_pr_err("error in pcmcia_get_first_tuple etc\n");
838 goto out1;
839 }
840
841 p_dev->conf.ConfigIndex = cfg->index;
842
843 /* Do we need to allocate an interrupt? */
844 if (cfg->irq.IRQInfo1) {
845 p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
846 }
847
848 /* IO window settings */
849 if (cfg->io.nwin != 1) {
850 lbs_pr_err("wrong CIS (check number of IO windows)\n");
851 ret = -ENODEV;
852 goto out1; 847 goto out1;
853 } 848 }
854 p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
855 p_dev->io.BasePort1 = io->win[0].base;
856 p_dev->io.NumPorts1 = io->win[0].len;
857 849
858 /* This reserves IO space but doesn't actually enable it */
859 ret = pcmcia_request_io(p_dev, &p_dev->io);
860 if (ret) {
861 lbs_pr_err("error in pcmcia_request_io\n");
862 goto out1;
863 }
864 850
865 /* 851 /*
866 * Allocate an interrupt line. Note that this does not assign 852 * Allocate an interrupt line. Note that this does not assign