diff options
author | David Woodhouse <dwmw2@infradead.org> | 2007-12-17 14:42:33 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-01-28 18:07:43 -0500 |
commit | 4694961cc2f868d6061be3b2c3d1fcf39584ff17 (patch) | |
tree | 1dfcb8ce20a1013015d8b726bd5c897fb7c17c22 | |
parent | b2c57eee66592e22327bf39b42c4e3dc24708213 (diff) |
libertas: Check for PS mode support on USB devices
Move the various firmware setup bits into a separate function, which
used to do just boot2 version.
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/libertas/if_usb.c | 28 |
1 files changed, 22 insertions, 6 deletions
diff --git a/drivers/net/wireless/libertas/if_usb.c b/drivers/net/wireless/libertas/if_usb.c index 8bc23b3ae640..3931fe6267ce 100644 --- a/drivers/net/wireless/libertas/if_usb.c +++ b/drivers/net/wireless/libertas/if_usb.c | |||
@@ -102,9 +102,10 @@ static void if_usb_free(struct if_usb_card *cardp) | |||
102 | lbs_deb_leave(LBS_DEB_USB); | 102 | lbs_deb_leave(LBS_DEB_USB); |
103 | } | 103 | } |
104 | 104 | ||
105 | static void if_usb_set_boot2_ver(struct lbs_private *priv) | 105 | static void if_usb_setup_firmware(struct lbs_private *priv) |
106 | { | 106 | { |
107 | struct cmd_ds_set_boot2_ver b2_cmd; | 107 | struct cmd_ds_set_boot2_ver b2_cmd; |
108 | struct cmd_ds_802_11_fw_wake_method wake_method; | ||
108 | 109 | ||
109 | b2_cmd.hdr.size = cpu_to_le16(sizeof(b2_cmd)); | 110 | b2_cmd.hdr.size = cpu_to_le16(sizeof(b2_cmd)); |
110 | b2_cmd.action = 0; | 111 | b2_cmd.action = 0; |
@@ -112,6 +113,25 @@ static void if_usb_set_boot2_ver(struct lbs_private *priv) | |||
112 | 113 | ||
113 | if (lbs_cmd_with_response(priv, CMD_SET_BOOT2_VER, &b2_cmd)) | 114 | if (lbs_cmd_with_response(priv, CMD_SET_BOOT2_VER, &b2_cmd)) |
114 | lbs_deb_usb("Setting boot2 version failed\n"); | 115 | lbs_deb_usb("Setting boot2 version failed\n"); |
116 | |||
117 | priv->wol_gpio = 2; /* Wake via GPIO2... */ | ||
118 | priv->wol_gap = 20; /* ... after 20ms */ | ||
119 | lbs_host_sleep_cfg(priv, EHS_WAKE_ON_UNICAST_DATA); | ||
120 | |||
121 | wake_method.hdr.size = cpu_to_le16(sizeof(wake_method)); | ||
122 | wake_method.action = cpu_to_le16(CMD_ACT_GET); | ||
123 | if (lbs_cmd_with_response(priv, CMD_802_11_FW_WAKE_METHOD, &wake_method)) { | ||
124 | lbs_pr_info("Firmware does not seem to support PS mode\n"); | ||
125 | } else { | ||
126 | if (le16_to_cpu(wake_method.method) == CMD_WAKE_METHOD_COMMAND_INT) { | ||
127 | lbs_deb_usb("Firmware seems to support PS with wake-via-command\n"); | ||
128 | priv->ps_supported = 1; | ||
129 | } else { | ||
130 | /* The versions which boot up this way don't seem to | ||
131 | work even if we set it to the command interrupt */ | ||
132 | lbs_pr_info("Firmware doesn't wake via command interrupt; disabling PS mode\n"); | ||
133 | } | ||
134 | } | ||
115 | } | 135 | } |
116 | 136 | ||
117 | static void if_usb_fw_timeo(unsigned long priv) | 137 | static void if_usb_fw_timeo(unsigned long priv) |
@@ -221,11 +241,7 @@ static int if_usb_probe(struct usb_interface *intf, | |||
221 | if (lbs_start_card(priv)) | 241 | if (lbs_start_card(priv)) |
222 | goto err_start_card; | 242 | goto err_start_card; |
223 | 243 | ||
224 | if_usb_set_boot2_ver(priv); | 244 | if_usb_setup_firmware(priv); |
225 | |||
226 | priv->wol_gpio = 2; /* Wake via GPIO2... */ | ||
227 | priv->wol_gap = 20; /* ... after 20ms */ | ||
228 | lbs_host_sleep_cfg(priv, EHS_WAKE_ON_UNICAST_DATA); | ||
229 | 245 | ||
230 | usb_get_dev(udev); | 246 | usb_get_dev(udev); |
231 | usb_set_intfdata(intf, cardp); | 247 | usb_set_intfdata(intf, cardp); |