aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/pcmcia/fmvj18x_cs.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/pcmcia/fmvj18x_cs.c')
-rw-r--r--drivers/net/pcmcia/fmvj18x_cs.c57
1 files changed, 35 insertions, 22 deletions
diff --git a/drivers/net/pcmcia/fmvj18x_cs.c b/drivers/net/pcmcia/fmvj18x_cs.c
index 356f50909222..388ecade13de 100644
--- a/drivers/net/pcmcia/fmvj18x_cs.c
+++ b/drivers/net/pcmcia/fmvj18x_cs.c
@@ -713,6 +713,39 @@ static void fmvj18x_release(dev_link_t *link)
713 link->state &= ~DEV_CONFIG; 713 link->state &= ~DEV_CONFIG;
714} 714}
715 715
716static int fmvj18x_suspend(struct pcmcia_device *p_dev)
717{
718 dev_link_t *link = dev_to_instance(p_dev);
719 struct net_device *dev = link->priv;
720
721 link->state |= DEV_SUSPEND;
722 if (link->state & DEV_CONFIG) {
723 if (link->open)
724 netif_device_detach(dev);
725 pcmcia_release_configuration(link->handle);
726 }
727
728
729 return 0;
730}
731
732static int fmvj18x_resume(struct pcmcia_device *p_dev)
733{
734 dev_link_t *link = dev_to_instance(p_dev);
735 struct net_device *dev = link->priv;
736
737 link->state &= ~DEV_SUSPEND;
738 if (link->state & DEV_CONFIG) {
739 pcmcia_request_configuration(link->handle, &link->conf);
740 if (link->open) {
741 fjn_reset(dev);
742 netif_device_attach(dev);
743 }
744 }
745
746 return 0;
747}
748
716/*====================================================================*/ 749/*====================================================================*/
717 750
718static int fmvj18x_event(event_t event, int priority, 751static int fmvj18x_event(event_t event, int priority,
@@ -733,28 +766,6 @@ static int fmvj18x_event(event_t event, int priority,
733 link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; 766 link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
734 fmvj18x_config(link); 767 fmvj18x_config(link);
735 break; 768 break;
736 case CS_EVENT_PM_SUSPEND:
737 link->state |= DEV_SUSPEND;
738 /* Fall through... */
739 case CS_EVENT_RESET_PHYSICAL:
740 if (link->state & DEV_CONFIG) {
741 if (link->open)
742 netif_device_detach(dev);
743 pcmcia_release_configuration(link->handle);
744 }
745 break;
746 case CS_EVENT_PM_RESUME:
747 link->state &= ~DEV_SUSPEND;
748 /* Fall through... */
749 case CS_EVENT_CARD_RESET:
750 if (link->state & DEV_CONFIG) {
751 pcmcia_request_configuration(link->handle, &link->conf);
752 if (link->open) {
753 fjn_reset(dev);
754 netif_device_attach(dev);
755 }
756 }
757 break;
758 } 769 }
759 return 0; 770 return 0;
760} /* fmvj18x_event */ 771} /* fmvj18x_event */
@@ -793,6 +804,8 @@ static struct pcmcia_driver fmvj18x_cs_driver = {
793 .event = fmvj18x_event, 804 .event = fmvj18x_event,
794 .detach = fmvj18x_detach, 805 .detach = fmvj18x_detach,
795 .id_table = fmvj18x_ids, 806 .id_table = fmvj18x_ids,
807 .suspend = fmvj18x_suspend,
808 .resume = fmvj18x_resume,
796}; 809};
797 810
798static int __init init_fmvj18x_cs(void) 811static int __init init_fmvj18x_cs(void)