128,15 → 128,23 |
static void hub_irq(struct urb *urb, struct pt_regs *regs) |
{ |
struct usb_hub *hub = (struct usb_hub *)urb->context; |
unsigned long flags; |
//** unsigned long flags; 2.6.1 |
int status; |
|
spin_lock(&hub_event_lock); |
hub->urb_active = 0; |
if (hub->urb_complete) { /* disconnect or rmmod */ |
complete(hub->urb_complete); |
goto done; |
} |
|
switch (urb->status) { |
case -ENOENT: /* synchronous unlink */ |
case -ECONNRESET: /* async unlink */ |
case -ESHUTDOWN: /* hardware going away */ |
return; |
|
goto done; |
//** return; 2.6.1 |
|
default: /* presumably an error */ |
/* Cause a hub reset after 10 consecutive errors */ |
dev_dbg (&hub->intf->dev, "transfer --> %d\n", urb->status); |
153,12 → 161,12 |
hub->nerrors = 0; |
|
/* Something happened, let khubd figure it out */ |
spin_lock_irqsave(&hub_event_lock, flags); |
//** spin_lock_irqsave(&hub_event_lock, flags); 2.6.1 |
if (list_empty(&hub->event_list)) { |
list_add(&hub->event_list, &hub_event_list); |
wake_up(&khubd_wait); |
} |
spin_unlock_irqrestore(&hub_event_lock, flags); |
//** spin_unlock_irqrestore(&hub_event_lock, flags); 2.6.1 |
|
resubmit: |
if ((status = usb_submit_urb (hub->urb, GFP_ATOMIC)) != 0 |
165,6 → 173,11 |
/* ENODEV means we raced disconnect() */ |
&& status != -ENODEV) |
dev_err (&hub->intf->dev, "resubmit --> %d\n", urb->status); |
|
if (status == 0) |
hub->urb_active = 1; |
done: |
spin_unlock(&hub_event_lock); |
} |
|
/* USB 2.0 spec Section 11.24.2.3 */ |
469,6 → 482,7 |
message = "couldn't submit status urb"; |
goto fail; |
} |
hub->urb_active = 1; |
|
/* Wake up khubd */ |
wake_up(&khubd_wait); |
487,6 → 501,7 |
static void hub_disconnect(struct usb_interface *intf) |
{ |
struct usb_hub *hub = usb_get_intfdata (intf); |
DECLARE_COMPLETION(urb_complete); |
unsigned long flags; |
|
if (!hub) |
494,12 → 509,11 |
|
usb_set_intfdata (intf, NULL); |
spin_lock_irqsave(&hub_event_lock, flags); |
hub->urb_complete = &urb_complete; |
|
/* Delete it and then reset it */ |
list_del(&hub->event_list); |
INIT_LIST_HEAD(&hub->event_list); |
list_del(&hub->hub_list); |
INIT_LIST_HEAD(&hub->hub_list); |
list_del_init(&hub->event_list); |
list_del_init(&hub->hub_list); |
|
spin_unlock_irqrestore(&hub_event_lock, flags); |
|
512,6 → 526,8 |
|
if (hub->urb) { |
usb_unlink_urb(hub->urb); |
if (hub->urb_active) |
wait_for_completion(&urb_complete); |
usb_free_urb(hub->urb); |
hub->urb = NULL; |
} |
1152,7 → 1168,6 |
// if (current->flags & PF_FREEZE) |
// refrigerator(PF_IOTHREAD); |
} while (!signal_pending(current)); |
printk(KERN_DEBUG "File: %s @hub_thread_exit\n", __FILE__); |
|
dbg("hub_thread exiting"); |
complete_and_exit(&khubd_exited, 0); |