Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 25767
b: refs/heads/master
c: 754a264
h: refs/heads/master
i:
  25765: b085bce
  25763: b422bc5
  25759: d50c085
v: v3
  • Loading branch information
Linus Torvalds committed Apr 15, 2006
1 parent 3745854 commit 264ddea
Show file tree
Hide file tree
Showing 44 changed files with 1,740 additions and 798 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: 4f705ae3e94ffaafe8d35f71ff4d5c499bb06814
refs/heads/master: 754a264c42178b85125a071299bb900b615c853b
52 changes: 41 additions & 11 deletions trunk/drivers/usb/atm/ueagle-atm.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@

#include "usbatm.h"

#define EAGLEUSBVERSION "ueagle 1.2"
#define EAGLEUSBVERSION "ueagle 1.3"


/*
Expand Down Expand Up @@ -243,7 +243,7 @@ enum {
#define BULK_TIMEOUT 300
#define CTRL_TIMEOUT 1000

#define ACK_TIMEOUT msecs_to_jiffies(1500)
#define ACK_TIMEOUT msecs_to_jiffies(3000)

#define UEA_INTR_IFACE_NO 0
#define UEA_US_IFACE_NO 1
Expand Down Expand Up @@ -314,6 +314,10 @@ struct cmv {
((d) & 0xff) << 16 | \
((a) & 0xff) << 8 | \
((b) & 0xff))
#define GETSA1(a) ((a >> 8) & 0xff)
#define GETSA2(a) (a & 0xff)
#define GETSA3(a) ((a >> 24) & 0xff)
#define GETSA4(a) ((a >> 16) & 0xff)

#define SA_CNTL MAKESA('C', 'N', 'T', 'L')
#define SA_DIAG MAKESA('D', 'I', 'A', 'G')
Expand Down Expand Up @@ -728,11 +732,12 @@ static void uea_load_page(void *xsc)
uea_err(INS_TO_USBDEV(sc), "sending DSP block %u failed\n", i);
return;
bad1:
uea_err(INS_TO_USBDEV(sc), "invalid DSP page %u requested\n",pageno);
uea_err(INS_TO_USBDEV(sc), "invalid DSP page %u requested\n", pageno);
}

static inline void wake_up_cmv_ack(struct uea_softc *sc)
{
BUG_ON(sc->cmv_ack);
sc->cmv_ack = 1;
wake_up(&sc->cmv_ack_wait);
}
Expand All @@ -743,6 +748,9 @@ static inline int wait_cmv_ack(struct uea_softc *sc)
sc->cmv_ack, ACK_TIMEOUT);
sc->cmv_ack = 0;

uea_dbg(INS_TO_USBDEV(sc), "wait_event_timeout : %d ms\n",
jiffies_to_msecs(ret));

if (ret < 0)
return ret;

Expand Down Expand Up @@ -791,6 +799,12 @@ static int uea_cmv(struct uea_softc *sc,
struct cmv cmv;
int ret;

uea_enters(INS_TO_USBDEV(sc));
uea_vdbg(INS_TO_USBDEV(sc), "Function : %d-%d, Address : %c%c%c%c, "
"offset : 0x%04x, data : 0x%08x\n",
FUNCTION_TYPE(function), FUNCTION_SUBTYPE(function),
GETSA1(address), GETSA2(address), GETSA3(address),
GETSA4(address), offset, data);
/* we send a request, but we expect a reply */
sc->cmv_function = function | 0x2;
sc->cmv_idx++;
Expand All @@ -808,7 +822,9 @@ static int uea_cmv(struct uea_softc *sc,
ret = uea_request(sc, UEA_SET_BLOCK, UEA_MPTX_START, CMV_SIZE, &cmv);
if (ret < 0)
return ret;
return wait_cmv_ack(sc);
ret = wait_cmv_ack(sc);
uea_leaves(INS_TO_USBDEV(sc));
return ret;
}

static inline int uea_read_cmv(struct uea_softc *sc,
Expand Down Expand Up @@ -922,7 +938,7 @@ static int uea_stat(struct uea_softc *sc)
* we check the status again in order to detect the failure earlier
*/
if (sc->stats.phy.flags) {
uea_dbg(INS_TO_USBDEV(sc), "Stat flag = %d\n",
uea_dbg(INS_TO_USBDEV(sc), "Stat flag = 0x%x\n",
sc->stats.phy.flags);
return 0;
}
Expand Down Expand Up @@ -1063,7 +1079,13 @@ static int uea_start_reset(struct uea_softc *sc)
uea_enters(INS_TO_USBDEV(sc));
uea_info(INS_TO_USBDEV(sc), "(re)booting started\n");

/* mask interrupt */
sc->booting = 1;
/* We need to set this here because, a ack timeout could have occured,
* but before we start the reboot, the ack occurs and set this to 1.
* So we will failed to wait Ready CMV.
*/
sc->cmv_ack = 0;
UPDATE_ATM_STAT(signal, ATM_PHY_SIG_LOST);

/* reset statistics */
Expand All @@ -1089,6 +1111,7 @@ static int uea_start_reset(struct uea_softc *sc)

msleep(1000);
sc->cmv_function = MAKEFUNCTION(ADSLDIRECTIVE, MODEMREADY);
/* demask interrupt */
sc->booting = 0;

/* start loading DSP */
Expand All @@ -1101,6 +1124,8 @@ static int uea_start_reset(struct uea_softc *sc)
if (ret < 0)
return ret;

uea_vdbg(INS_TO_USBDEV(sc), "Ready CMV received\n");

/* Enter in R-IDLE (cmv) until instructed otherwise */
ret = uea_write_cmv(sc, SA_CNTL, 0, 1);
if (ret < 0)
Expand All @@ -1121,6 +1146,7 @@ static int uea_start_reset(struct uea_softc *sc)
}
/* Enter in R-ACT-REQ */
ret = uea_write_cmv(sc, SA_CNTL, 0, 2);
uea_vdbg(INS_TO_USBDEV(sc), "Entering in R-ACT-REQ state\n");
out:
release_firmware(cmvs_fw);
sc->reset = 0;
Expand Down Expand Up @@ -1235,6 +1261,7 @@ static void uea_dispatch_cmv(struct uea_softc *sc, struct cmv* cmv)

if (cmv->bFunction == MAKEFUNCTION(ADSLDIRECTIVE, MODEMREADY)) {
wake_up_cmv_ack(sc);
uea_leaves(INS_TO_USBDEV(sc));
return;
}

Expand All @@ -1249,19 +1276,22 @@ static void uea_dispatch_cmv(struct uea_softc *sc, struct cmv* cmv)
sc->data = sc->data << 16 | sc->data >> 16;

wake_up_cmv_ack(sc);
uea_leaves(INS_TO_USBDEV(sc));
return;

bad2:
uea_err(INS_TO_USBDEV(sc), "unexpected cmv received,"
"Function : %d, Subfunction : %d\n",
FUNCTION_TYPE(cmv->bFunction),
FUNCTION_SUBTYPE(cmv->bFunction));
uea_leaves(INS_TO_USBDEV(sc));
return;

bad1:
uea_err(INS_TO_USBDEV(sc), "invalid cmv received, "
"wPreamble %d, bDirection %d\n",
le16_to_cpu(cmv->wPreamble), cmv->bDirection);
uea_leaves(INS_TO_USBDEV(sc));
}

/*
Expand Down Expand Up @@ -1346,7 +1376,7 @@ static int uea_boot(struct uea_softc *sc)
if (ret < 0) {
uea_err(INS_TO_USBDEV(sc),
"urb submition failed with error %d\n", ret);
goto err1;
goto err;
}

sc->kthread = kthread_run(uea_kthread, sc, "ueagle-atm");
Expand All @@ -1360,10 +1390,10 @@ static int uea_boot(struct uea_softc *sc)

err2:
usb_kill_urb(sc->urb_int);
err1:
kfree(intr);
err:
usb_free_urb(sc->urb_int);
sc->urb_int = NULL;
kfree(intr);
uea_leaves(INS_TO_USBDEV(sc));
return -ENOMEM;
}
Expand Down Expand Up @@ -1508,15 +1538,15 @@ static ssize_t read_##name(struct device *dev, \
int ret = -ENODEV; \
struct uea_softc *sc; \
\
mutex_lock(&uea_mutex); \
mutex_lock(&uea_mutex); \
sc = dev_to_uea(dev); \
if (!sc) \
goto out; \
ret = snprintf(buf, 10, "%08x\n", sc->stats.phy.name); \
if (reset) \
sc->stats.phy.name = 0; \
out: \
mutex_unlock(&uea_mutex); \
mutex_unlock(&uea_mutex); \
return ret; \
} \
\
Expand Down Expand Up @@ -1643,7 +1673,7 @@ static int uea_bind(struct usbatm_data *usbatm, struct usb_interface *intf,

sc = kzalloc(sizeof(struct uea_softc), GFP_KERNEL);
if (!sc) {
uea_err(INS_TO_USBDEV(sc), "uea_init: not enough memory !\n");
uea_err(usb, "uea_init: not enough memory !\n");
return -ENOMEM;
}

Expand Down
7 changes: 7 additions & 0 deletions trunk/drivers/usb/core/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -99,4 +99,11 @@ config USB_OTG_WHITELIST
normal Linux-USB hosts do (other than the warning), and is
convenient for many stages of product development.

config USB_OTG_BLACKLIST_HUB
bool "Disable external hubs"
depends on USB_OTG
help
If you say Y here, then Linux will refuse to enumerate
external hubs. OTG hosts are allowed to reduce hardware
and software costs by not supporting external hubs.

8 changes: 7 additions & 1 deletion trunk/drivers/usb/core/hub.c
Original file line number Diff line number Diff line change
Expand Up @@ -836,6 +836,13 @@ static int hub_probe(struct usb_interface *intf, const struct usb_device_id *id)
desc = intf->cur_altsetting;
hdev = interface_to_usbdev(intf);

#ifdef CONFIG_USB_OTG_BLACKLIST_HUB
if (hdev->parent) {
dev_warn(&intf->dev, "ignoring external hub\n");
return -ENODEV;
}
#endif

/* Some hubs have a subclass of 1, which AFAICT according to the */
/* specs is not defined, but it works */
if ((desc->desc.bInterfaceSubClass != 0) &&
Expand Down Expand Up @@ -1022,7 +1029,6 @@ void usb_set_device_state(struct usb_device *udev,
recursively_mark_NOTATTACHED(udev);
spin_unlock_irqrestore(&device_state_lock, flags);
}
EXPORT_SYMBOL(usb_set_device_state);


#ifdef CONFIG_PM
Expand Down
2 changes: 0 additions & 2 deletions trunk/drivers/usb/core/usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -1194,7 +1194,6 @@ EXPORT_SYMBOL(usb_disabled);
EXPORT_SYMBOL_GPL(usb_get_intf);
EXPORT_SYMBOL_GPL(usb_put_intf);

EXPORT_SYMBOL(usb_alloc_dev);
EXPORT_SYMBOL(usb_put_dev);
EXPORT_SYMBOL(usb_get_dev);
EXPORT_SYMBOL(usb_hub_tt_clear_buffer);
Expand All @@ -1208,7 +1207,6 @@ EXPORT_SYMBOL(usb_ifnum_to_if);
EXPORT_SYMBOL(usb_altnum_to_altsetting);

EXPORT_SYMBOL(usb_reset_device);
EXPORT_SYMBOL(usb_disconnect);

EXPORT_SYMBOL(__usb_get_extra_descriptor);

Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/usb/gadget/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,11 @@ choice
often need board-specific hooks.

config USB_GADGET_NET2280
boolean "NetChip 2280"
boolean "NetChip 228x"
depends on PCI
select USB_GADGET_DUALSPEED
help
NetChip 2280 is a PCI based USB peripheral controller which
NetChip 2280 / 2282 is a PCI based USB peripheral controller which
supports both full and high speed USB 2.0 data transfers.

It has six configurable endpoints, as well as endpoint zero
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/usb/gadget/at91_udc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1709,7 +1709,7 @@ static int __devexit at91udc_remove(struct platform_device *dev)
}

#ifdef CONFIG_PM
static int at91udc_suspend(struct platform_device *dev, u32 state, u32 level)
static int at91udc_suspend(struct platform_device *dev, pm_message_t mesg)
{
struct at91_udc *udc = platform_get_drvdata(dev);

Expand All @@ -1731,7 +1731,7 @@ static int at91udc_suspend(struct platform_device *dev, u32 state, u32 level)
return 0;
}

static int at91udc_resume(struct platform_device *dev, u32 level)
static int at91udc_resume(struct platform_device *dev)
{
struct at91_udc *udc = platform_get_drvdata(dev);

Expand Down
6 changes: 3 additions & 3 deletions trunk/drivers/usb/gadget/ether.c
Original file line number Diff line number Diff line change
Expand Up @@ -2338,6 +2338,9 @@ eth_bind (struct usb_gadget *gadget)
hs_subset_descriptors();
}

device_desc.bMaxPacketSize0 = gadget->ep0->maxpacket;
usb_gadget_set_selfpowered (gadget);

/* For now RNDIS is always a second config */
if (rndis)
device_desc.bNumConfigurations = 2;
Expand All @@ -2361,9 +2364,6 @@ eth_bind (struct usb_gadget *gadget)
#endif
#endif /* DUALSPEED */

device_desc.bMaxPacketSize0 = gadget->ep0->maxpacket;
usb_gadget_set_selfpowered (gadget);

if (gadget->is_otg) {
otg_descriptor.bmAttributes |= USB_OTG_HNP,
eth_config.bmAttributes |= USB_CONFIG_ATT_WAKEUP;
Expand Down
Loading

0 comments on commit 264ddea

Please sign in to comment.