diff options
Diffstat (limited to 'drivers/net/wireless/netwave_cs.c')
-rw-r--r-- | drivers/net/wireless/netwave_cs.c | 57 |
1 files changed, 35 insertions, 22 deletions
diff --git a/drivers/net/wireless/netwave_cs.c b/drivers/net/wireless/netwave_cs.c index 92793b958e32..7ab2d70ffddf 100644 --- a/drivers/net/wireless/netwave_cs.c +++ b/drivers/net/wireless/netwave_cs.c | |||
@@ -935,6 +935,39 @@ static void netwave_release(dev_link_t *link) | |||
935 | link->state &= ~DEV_CONFIG; | 935 | link->state &= ~DEV_CONFIG; |
936 | } | 936 | } |
937 | 937 | ||
938 | static int netwave_suspend(struct pcmcia_device *p_dev) | ||
939 | { | ||
940 | dev_link_t *link = dev_to_instance(p_dev); | ||
941 | struct net_device *dev = link->priv; | ||
942 | |||
943 | link->state |= DEV_SUSPEND; | ||
944 | if (link->state & DEV_CONFIG) { | ||
945 | if (link->open) | ||
946 | netif_device_detach(dev); | ||
947 | pcmcia_release_configuration(link->handle); | ||
948 | } | ||
949 | |||
950 | return 0; | ||
951 | } | ||
952 | |||
953 | static int netwave_resume(struct pcmcia_device *p_dev) | ||
954 | { | ||
955 | dev_link_t *link = dev_to_instance(p_dev); | ||
956 | struct net_device *dev = link->priv; | ||
957 | |||
958 | link->state &= ~DEV_SUSPEND; | ||
959 | if (link->state & DEV_CONFIG) { | ||
960 | pcmcia_request_configuration(link->handle, &link->conf); | ||
961 | if (link->open) { | ||
962 | netwave_reset(dev); | ||
963 | netif_device_attach(dev); | ||
964 | } | ||
965 | } | ||
966 | |||
967 | return 0; | ||
968 | } | ||
969 | |||
970 | |||
938 | /* | 971 | /* |
939 | * Function netwave_event (event, priority, args) | 972 | * Function netwave_event (event, priority, args) |
940 | * | 973 | * |
@@ -973,28 +1006,6 @@ static int netwave_event(event_t event, int priority, | |||
973 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; | 1006 | link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; |
974 | netwave_pcmcia_config( link); | 1007 | netwave_pcmcia_config( link); |
975 | break; | 1008 | break; |
976 | case CS_EVENT_PM_SUSPEND: | ||
977 | link->state |= DEV_SUSPEND; | ||
978 | /* Fall through... */ | ||
979 | case CS_EVENT_RESET_PHYSICAL: | ||
980 | if (link->state & DEV_CONFIG) { | ||
981 | if (link->open) | ||
982 | netif_device_detach(dev); | ||
983 | pcmcia_release_configuration(link->handle); | ||
984 | } | ||
985 | break; | ||
986 | case CS_EVENT_PM_RESUME: | ||
987 | link->state &= ~DEV_SUSPEND; | ||
988 | /* Fall through... */ | ||
989 | case CS_EVENT_CARD_RESET: | ||
990 | if (link->state & DEV_CONFIG) { | ||
991 | pcmcia_request_configuration(link->handle, &link->conf); | ||
992 | if (link->open) { | ||
993 | netwave_reset(dev); | ||
994 | netif_device_attach(dev); | ||
995 | } | ||
996 | } | ||
997 | break; | ||
998 | } | 1009 | } |
999 | return 0; | 1010 | return 0; |
1000 | } /* netwave_event */ | 1011 | } /* netwave_event */ |
@@ -1495,6 +1506,8 @@ static struct pcmcia_driver netwave_driver = { | |||
1495 | .event = netwave_event, | 1506 | .event = netwave_event, |
1496 | .detach = netwave_detach, | 1507 | .detach = netwave_detach, |
1497 | .id_table = netwave_ids, | 1508 | .id_table = netwave_ids, |
1509 | .suspend = netwave_suspend, | ||
1510 | .resume = netwave_resume, | ||
1498 | }; | 1511 | }; |
1499 | 1512 | ||
1500 | static int __init init_netwave_cs(void) | 1513 | static int __init init_netwave_cs(void) |