aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/libertas
diff options
context:
space:
mode:
authorMarek Vasut <marek.vasut@gmail.com>2009-03-24 16:33:43 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-04-22 16:57:15 -0400
commitdc7d243d75b906cc964c12caa3b2eebe953a69be (patch)
tree456e2aad5e3cc4abb17bfcbfd7f8fcbcfd263d5c /drivers/net/wireless/libertas
parentfade5db4f227bf59874efd6023f39d345e17e2a4 (diff)
Add support for CF8381 WiFi card.
A detection function was added for identifying CF8381. Signed-off-by: Marek Vasut <marek.vasut@gmail.com> Acked-by: Dan Williams <dcbw@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/libertas')
-rw-r--r--drivers/net/wireless/libertas/if_cs.c34
1 files changed, 32 insertions, 2 deletions
diff --git a/drivers/net/wireless/libertas/if_cs.c b/drivers/net/wireless/libertas/if_cs.c
index cedeac6322fe..2a5b083bf9bd 100644
--- a/drivers/net/wireless/libertas/if_cs.c
+++ b/drivers/net/wireless/libertas/if_cs.c
@@ -273,7 +273,28 @@ static int if_cs_poll_while_fw_download(struct if_cs_card *card, uint addr, u8 r
273 */ 273 */
274#define IF_CS_PRODUCT_ID 0x0000001C 274#define IF_CS_PRODUCT_ID 0x0000001C
275#define IF_CS_CF8385_B1_REV 0x12 275#define IF_CS_CF8385_B1_REV 0x12
276#define IF_CS_CF8381_B3_REV 0x04
276 277
278/*
279 * Used to detect other cards than CF8385 since their revisions of silicon
280 * doesn't match those from CF8385, eg. CF8381 B3 works with this driver.
281 */
282#define CF8381_MANFID 0x02db
283#define CF8381_CARDID 0x6064
284#define CF8385_MANFID 0x02df
285#define CF8385_CARDID 0x8103
286
287static inline int if_cs_hw_is_cf8381(struct pcmcia_device *p_dev)
288{
289 return (p_dev->manf_id == CF8381_MANFID &&
290 p_dev->card_id == CF8381_CARDID);
291}
292
293static inline int if_cs_hw_is_cf8385(struct pcmcia_device *p_dev)
294{
295 return (p_dev->manf_id == CF8385_MANFID &&
296 p_dev->card_id == CF8385_CARDID);
297}
277 298
278/********************************************************************/ 299/********************************************************************/
279/* I/O and interrupt handling */ 300/* I/O and interrupt handling */
@@ -757,6 +778,7 @@ static void if_cs_release(struct pcmcia_device *p_dev)
757static int if_cs_probe(struct pcmcia_device *p_dev) 778static int if_cs_probe(struct pcmcia_device *p_dev)
758{ 779{
759 int ret = -ENOMEM; 780 int ret = -ENOMEM;
781 unsigned int prod_id;
760 struct lbs_private *priv; 782 struct lbs_private *priv;
761 struct if_cs_card *card; 783 struct if_cs_card *card;
762 /* CIS parsing */ 784 /* CIS parsing */
@@ -859,7 +881,14 @@ static int if_cs_probe(struct pcmcia_device *p_dev)
859 p_dev->io.BasePort1 + p_dev->io.NumPorts1 - 1); 881 p_dev->io.BasePort1 + p_dev->io.NumPorts1 - 1);
860 882
861 /* Check if we have a current silicon */ 883 /* Check if we have a current silicon */
862 if (if_cs_read8(card, IF_CS_PRODUCT_ID) < IF_CS_CF8385_B1_REV) { 884 prod_id = if_cs_read8(card, IF_CS_PRODUCT_ID);
885 if (if_cs_hw_is_cf8381(p_dev) && prod_id < IF_CS_CF8381_B3_REV) {
886 lbs_pr_err("old chips like 8381 rev B3 aren't supported\n");
887 ret = -ENODEV;
888 goto out2;
889 }
890
891 if (if_cs_hw_is_cf8385(p_dev) && prod_id < IF_CS_CF8385_B1_REV) {
863 lbs_pr_err("old chips like 8385 rev B1 aren't supported\n"); 892 lbs_pr_err("old chips like 8385 rev B1 aren't supported\n");
864 ret = -ENODEV; 893 ret = -ENODEV;
865 goto out2; 894 goto out2;
@@ -950,7 +979,8 @@ static void if_cs_detach(struct pcmcia_device *p_dev)
950/********************************************************************/ 979/********************************************************************/
951 980
952static struct pcmcia_device_id if_cs_ids[] = { 981static struct pcmcia_device_id if_cs_ids[] = {
953 PCMCIA_DEVICE_MANF_CARD(0x02df, 0x8103), 982 PCMCIA_DEVICE_MANF_CARD(CF8381_MANFID, CF8381_CARDID),
983 PCMCIA_DEVICE_MANF_CARD(CF8385_MANFID, CF8385_CARDID),
954 PCMCIA_DEVICE_NULL, 984 PCMCIA_DEVICE_NULL,
955}; 985};
956MODULE_DEVICE_TABLE(pcmcia, if_cs_ids); 986MODULE_DEVICE_TABLE(pcmcia, if_cs_ids);