diff options
Diffstat (limited to 'drivers/net/pcmcia/xirc2ps_cs.c')
-rw-r--r-- | drivers/net/pcmcia/xirc2ps_cs.c | 40 |
1 files changed, 12 insertions, 28 deletions
diff --git a/drivers/net/pcmcia/xirc2ps_cs.c b/drivers/net/pcmcia/xirc2ps_cs.c index f3914f58d67f..8478dca3d8d1 100644 --- a/drivers/net/pcmcia/xirc2ps_cs.c +++ b/drivers/net/pcmcia/xirc2ps_cs.c | |||
@@ -332,6 +332,7 @@ static irqreturn_t xirc2ps_interrupt(int irq, void *dev_id); | |||
332 | */ | 332 | */ |
333 | 333 | ||
334 | typedef struct local_info_t { | 334 | typedef struct local_info_t { |
335 | struct net_device *dev; | ||
335 | struct pcmcia_device *p_dev; | 336 | struct pcmcia_device *p_dev; |
336 | dev_node_t node; | 337 | dev_node_t node; |
337 | struct net_device_stats stats; | 338 | struct net_device_stats stats; |
@@ -353,7 +354,7 @@ typedef struct local_info_t { | |||
353 | */ | 354 | */ |
354 | static int do_start_xmit(struct sk_buff *skb, struct net_device *dev); | 355 | static int do_start_xmit(struct sk_buff *skb, struct net_device *dev); |
355 | static void do_tx_timeout(struct net_device *dev); | 356 | static void do_tx_timeout(struct net_device *dev); |
356 | static void xirc2ps_tx_timeout_task(void *data); | 357 | static void xirc2ps_tx_timeout_task(struct work_struct *work); |
357 | static struct net_device_stats *do_get_stats(struct net_device *dev); | 358 | static struct net_device_stats *do_get_stats(struct net_device *dev); |
358 | static void set_addresses(struct net_device *dev); | 359 | static void set_addresses(struct net_device *dev); |
359 | static void set_multicast_list(struct net_device *dev); | 360 | static void set_multicast_list(struct net_device *dev); |
@@ -567,6 +568,7 @@ xirc2ps_probe(struct pcmcia_device *link) | |||
567 | if (!dev) | 568 | if (!dev) |
568 | return -ENOMEM; | 569 | return -ENOMEM; |
569 | local = netdev_priv(dev); | 570 | local = netdev_priv(dev); |
571 | local->dev = dev; | ||
570 | local->p_dev = link; | 572 | local->p_dev = link; |
571 | link->priv = dev; | 573 | link->priv = dev; |
572 | 574 | ||
@@ -591,7 +593,7 @@ xirc2ps_probe(struct pcmcia_device *link) | |||
591 | #ifdef HAVE_TX_TIMEOUT | 593 | #ifdef HAVE_TX_TIMEOUT |
592 | dev->tx_timeout = do_tx_timeout; | 594 | dev->tx_timeout = do_tx_timeout; |
593 | dev->watchdog_timeo = TX_TIMEOUT; | 595 | dev->watchdog_timeo = TX_TIMEOUT; |
594 | INIT_WORK(&local->tx_timeout_task, xirc2ps_tx_timeout_task, dev); | 596 | INIT_WORK(&local->tx_timeout_task, xirc2ps_tx_timeout_task); |
595 | #endif | 597 | #endif |
596 | 598 | ||
597 | return xirc2ps_config(link); | 599 | return xirc2ps_config(link); |
@@ -707,22 +709,11 @@ set_card_type(struct pcmcia_device *link, const void *s) | |||
707 | * Returns: true if this is a CE2 | 709 | * Returns: true if this is a CE2 |
708 | */ | 710 | */ |
709 | static int | 711 | static int |
710 | has_ce2_string(struct pcmcia_device * link) | 712 | has_ce2_string(struct pcmcia_device * p_dev) |
711 | { | 713 | { |
712 | tuple_t tuple; | 714 | if (p_dev->prod_id[2] && strstr(p_dev->prod_id[2], "CE2")) |
713 | cisparse_t parse; | 715 | return 1; |
714 | u_char buf[256]; | 716 | return 0; |
715 | |||
716 | tuple.Attributes = 0; | ||
717 | tuple.TupleData = buf; | ||
718 | tuple.TupleDataMax = 254; | ||
719 | tuple.TupleOffset = 0; | ||
720 | tuple.DesiredTuple = CISTPL_VERS_1; | ||
721 | if (!first_tuple(link, &tuple, &parse) && parse.version_1.ns > 2) { | ||
722 | if (strstr(parse.version_1.str + parse.version_1.ofs[2], "CE2")) | ||
723 | return 1; | ||
724 | } | ||
725 | return 0; | ||
726 | } | 717 | } |
727 | 718 | ||
728 | /**************** | 719 | /**************** |
@@ -792,13 +783,6 @@ xirc2ps_config(struct pcmcia_device * link) | |||
792 | goto failure; | 783 | goto failure; |
793 | } | 784 | } |
794 | 785 | ||
795 | /* get configuration stuff */ | ||
796 | tuple.DesiredTuple = CISTPL_CONFIG; | ||
797 | if ((err=first_tuple(link, &tuple, &parse))) | ||
798 | goto cis_error; | ||
799 | link->conf.ConfigBase = parse.config.base; | ||
800 | link->conf.Present = parse.config.rmask[0]; | ||
801 | |||
802 | /* get the ethernet address from the CIS */ | 786 | /* get the ethernet address from the CIS */ |
803 | tuple.DesiredTuple = CISTPL_FUNCE; | 787 | tuple.DesiredTuple = CISTPL_FUNCE; |
804 | for (err = first_tuple(link, &tuple, &parse); !err; | 788 | for (err = first_tuple(link, &tuple, &parse); !err; |
@@ -1062,8 +1046,6 @@ xirc2ps_config(struct pcmcia_device * link) | |||
1062 | xirc2ps_release(link); | 1046 | xirc2ps_release(link); |
1063 | return -ENODEV; | 1047 | return -ENODEV; |
1064 | 1048 | ||
1065 | cis_error: | ||
1066 | printk(KNOT_XIRC "unable to parse CIS\n"); | ||
1067 | failure: | 1049 | failure: |
1068 | return -ENODEV; | 1050 | return -ENODEV; |
1069 | } /* xirc2ps_config */ | 1051 | } /* xirc2ps_config */ |
@@ -1344,9 +1326,11 @@ xirc2ps_interrupt(int irq, void *dev_id) | |||
1344 | /*====================================================================*/ | 1326 | /*====================================================================*/ |
1345 | 1327 | ||
1346 | static void | 1328 | static void |
1347 | xirc2ps_tx_timeout_task(void *data) | 1329 | xirc2ps_tx_timeout_task(struct work_struct *work) |
1348 | { | 1330 | { |
1349 | struct net_device *dev = data; | 1331 | local_info_t *local = |
1332 | container_of(work, local_info_t, tx_timeout_task); | ||
1333 | struct net_device *dev = local->dev; | ||
1350 | /* reset the card */ | 1334 | /* reset the card */ |
1351 | do_reset(dev,1); | 1335 | do_reset(dev,1); |
1352 | dev->trans_start = jiffies; | 1336 | dev->trans_start = jiffies; |