diff options
author | David Woodhouse <dwmw2@infradead.org> | 2008-05-20 11:48:52 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-06-03 15:00:13 -0400 |
commit | b77ec4caefb280092a45d6798cbc2fd966ad01d8 (patch) | |
tree | d6273e4a4bbde4b24b84a4297254a46c6bc905a5 /drivers/net | |
parent | 04dea136b06ddd58879c9272b9f66ff060962317 (diff) |
libertas: provide reset_card() callback on OLPC
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/wireless/libertas/if_usb.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/drivers/net/wireless/libertas/if_usb.c b/drivers/net/wireless/libertas/if_usb.c index 8032df72aaab..24783103a7dd 100644 --- a/drivers/net/wireless/libertas/if_usb.c +++ b/drivers/net/wireless/libertas/if_usb.c | |||
@@ -7,6 +7,10 @@ | |||
7 | #include <linux/netdevice.h> | 7 | #include <linux/netdevice.h> |
8 | #include <linux/usb.h> | 8 | #include <linux/usb.h> |
9 | 9 | ||
10 | #ifdef CONFIG_OLPC | ||
11 | #include <asm/olpc.h> | ||
12 | #endif | ||
13 | |||
10 | #define DRV_NAME "usb8xxx" | 14 | #define DRV_NAME "usb8xxx" |
11 | 15 | ||
12 | #include "host.h" | 16 | #include "host.h" |
@@ -146,6 +150,14 @@ static void if_usb_fw_timeo(unsigned long priv) | |||
146 | wake_up(&cardp->fw_wq); | 150 | wake_up(&cardp->fw_wq); |
147 | } | 151 | } |
148 | 152 | ||
153 | #ifdef CONFIG_OLPC | ||
154 | static void if_usb_reset_olpc_card(struct lbs_private *priv) | ||
155 | { | ||
156 | printk(KERN_CRIT "Resetting OLPC wireless via EC...\n"); | ||
157 | olpc_ec_cmd(0x25, NULL, 0, NULL, 0); | ||
158 | } | ||
159 | #endif | ||
160 | |||
149 | /** | 161 | /** |
150 | * @brief sets the configuration values | 162 | * @brief sets the configuration values |
151 | * @param ifnum interface number | 163 | * @param ifnum interface number |
@@ -231,6 +243,11 @@ static int if_usb_probe(struct usb_interface *intf, | |||
231 | cardp->priv->fw_ready = 1; | 243 | cardp->priv->fw_ready = 1; |
232 | 244 | ||
233 | priv->hw_host_to_card = if_usb_host_to_card; | 245 | priv->hw_host_to_card = if_usb_host_to_card; |
246 | #ifdef CONFIG_OLPC | ||
247 | if (machine_is_olpc()) | ||
248 | priv->reset_card = if_usb_reset_olpc_card; | ||
249 | #endif | ||
250 | |||
234 | cardp->boot2_version = udev->descriptor.bcdDevice; | 251 | cardp->boot2_version = udev->descriptor.bcdDevice; |
235 | 252 | ||
236 | if_usb_submit_rx_urb(cardp); | 253 | if_usb_submit_rx_urb(cardp); |
@@ -364,6 +381,11 @@ static int if_usb_reset_device(struct if_usb_card *cardp) | |||
364 | ret = usb_reset_device(cardp->udev); | 381 | ret = usb_reset_device(cardp->udev); |
365 | msleep(100); | 382 | msleep(100); |
366 | 383 | ||
384 | #ifdef CONFIG_OLPC | ||
385 | if (ret && machine_is_olpc()) | ||
386 | if_usb_reset_olpc_card(NULL); | ||
387 | #endif | ||
388 | |||
367 | lbs_deb_leave_args(LBS_DEB_USB, "ret %d", ret); | 389 | lbs_deb_leave_args(LBS_DEB_USB, "ret %d", ret); |
368 | 390 | ||
369 | return ret; | 391 | return ret; |