Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 66450
b: refs/heads/master
c: eedc2a3
h: refs/heads/master
v: v3
  • Loading branch information
Dan Williams authored and David S. Miller committed Oct 10, 2007
1 parent 79c15d4 commit d41d576
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 22 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ffcae953ac021f5051a201c18e133cb0ce38c2b9
refs/heads/master: eedc2a319154a64f5ca7f281c92b7af3691fe73c
2 changes: 1 addition & 1 deletion trunk/drivers/net/wireless/libertas/decl.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,6 @@ int libertas_activate_card(wlan_private *priv, char *fw_name);
int libertas_remove_card(wlan_private *priv);
int libertas_add_mesh(wlan_private *priv, struct device *dev);
void libertas_remove_mesh(wlan_private *priv);

int libertas_reset_device(wlan_private *priv);

#endif /* _WLAN_DECL_H_ */
30 changes: 10 additions & 20 deletions trunk/drivers/net/wireless/libertas/if_usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include "defs.h"
#include "dev.h"
#include "if_usb.h"
#include "decl.h"

#define MESSAGE_HEADER_LEN 4

Expand Down Expand Up @@ -44,7 +45,6 @@ MODULE_DEVICE_TABLE(usb, if_usb_table);

static void if_usb_receive(struct urb *urb);
static void if_usb_receive_fwload(struct urb *urb);
static int if_usb_reset_device(wlan_private *priv);
static int if_usb_register_dev(wlan_private * priv);
static int if_usb_unregister_dev(wlan_private *);
static int if_usb_prog_firmware(wlan_private *);
Expand Down Expand Up @@ -355,17 +355,20 @@ static int if_prog_firmware(wlan_private * priv)
return 0;
}

static int libertas_do_reset(wlan_private *priv)
static int if_usb_reset_device(wlan_private *priv)
{
int ret;
struct usb_card_rec *cardp = priv->card;

lbs_deb_enter(LBS_DEB_USB);

/* Try a USB port reset first, if that fails send the reset
* command to the firmware.
*/
ret = usb_reset_device(cardp->udev);
if (!ret) {
msleep(10);
if_usb_reset_device(priv);
ret = libertas_reset_device(priv);
msleep(10);
}

Expand Down Expand Up @@ -753,19 +756,6 @@ static int if_usb_read_event_cause(wlan_private * priv)
return 0;
}

static int if_usb_reset_device(wlan_private *priv)
{
int ret;

lbs_deb_enter(LBS_DEB_USB);
ret = libertas_prepare_and_send_command(priv, CMD_802_11_RESET,
CMD_ACT_HALT, 0, 0, NULL);
msleep_interruptible(10);

lbs_deb_leave_args(LBS_DEB_USB, "ret %d", ret);
return ret;
}

static int if_usb_unregister_dev(wlan_private * priv)
{
int ret = 0;
Expand All @@ -775,7 +765,7 @@ static int if_usb_unregister_dev(wlan_private * priv)
* again.
*/
if (priv)
if_usb_reset_device(priv);
libertas_reset_device(priv);

return ret;
}
Expand Down Expand Up @@ -862,7 +852,7 @@ static int if_usb_prog_firmware(wlan_private * priv)

if (cardp->bootcmdresp == 0) {
if (--reset_count >= 0) {
libertas_do_reset(priv);
if_usb_reset_device(priv);
goto restart;
}
return -1;
Expand Down Expand Up @@ -892,7 +882,7 @@ static int if_usb_prog_firmware(wlan_private * priv)
if (!cardp->fwdnldover) {
lbs_pr_info("failed to load fw, resetting device!\n");
if (--reset_count >= 0) {
libertas_do_reset(priv);
if_usb_reset_device(priv);
goto restart;
}

Expand Down Expand Up @@ -995,7 +985,7 @@ static void if_usb_exit_module(void)
lbs_deb_enter(LBS_DEB_MAIN);

list_for_each_entry_safe(cardp, cardp_temp, &usb_devices, list)
if_usb_reset_device((wlan_private *) cardp->priv);
libertas_reset_device((wlan_private *) cardp->priv);

/* API unregisters the driver from USB subsystem */
usb_deregister(&if_usb_driver);
Expand Down
14 changes: 14 additions & 0 deletions trunk/drivers/net/wireless/libertas/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1157,6 +1157,20 @@ void libertas_interrupt(struct net_device *dev)
}
EXPORT_SYMBOL_GPL(libertas_interrupt);

int libertas_reset_device(wlan_private *priv)
{
int ret;

lbs_deb_enter(LBS_DEB_MAIN);
ret = libertas_prepare_and_send_command(priv, CMD_802_11_RESET,
CMD_ACT_HALT, 0, 0, NULL);
msleep_interruptible(10);

lbs_deb_leave_args(LBS_DEB_MAIN, "ret %d", ret);
return ret;
}
EXPORT_SYMBOL_GPL(libertas_reset_device);

static int libertas_init_module(void)
{
lbs_deb_enter(LBS_DEB_MAIN);
Expand Down

0 comments on commit d41d576

Please sign in to comment.