#include "../cache.h" #include "../progress.h" #include "../libslang.h" #include "../ui.h" #include "tui.h" #include "../browser.h" static void tui_progress__update(struct ui_progress *p) { int bar, y; /* * FIXME: We should have a per UI backend way of showing progress, * stdio will just show a percentage as NN%, etc. */ if (use_browser <= 0) return; if (p->total == 0) return; ui__refresh_dimensions(false); pthread_mutex_lock(&ui__lock); y = SLtt_Screen_Rows / 2 - 2; SLsmg_set_color(0); SLsmg_draw_box(y, 0, 3, SLtt_Screen_Cols); SLsmg_gotorc(y++, 1); SLsmg_write_string((char *)p->title); SLsmg_fill_region(y, 1, 1, SLtt_Screen_Cols - 2, ' '); SLsmg_set_color(HE_COLORSET_SELECTED); bar = ((SLtt_Screen_Cols - 2) * p->curr) / p->total; SLsmg_fill_region(y, 1, 1, bar, ' '); SLsmg_refresh(); pthread_mutex_unlock(&ui__lock); } static void tui_progress__finish(void) { int y; if (use_browser <= 0) return; ui__refresh_dimensions(false); pthread_mutex_lock(&ui__lock); y = SLtt_Screen_Rows / 2 - 2; SLsmg_set_color(0); SLsmg_fill_region(y, 0, 3, SLtt_Screen_Cols, ' '); SLsmg_refresh(); pthread_mutex_unlock(&ui__lock); } static struct ui_progress_ops tui_progress__ops = { .update = tui_progress__update, .finish = tui_progress__finish, }; void tui_progress__init(void) { ui_progress__ops = &tui_progress__ops; } > net-next plumbingsTobias Klauser
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLu Baolu <baolu.lu@linux.intel.com>2017-01-03 18:28:44 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-01-03 17:37:32 +0100
commit90797aee5d6902b49a453c97d83c326408aeb5a8 (patch)
tree73b3a5c7aa02cca8ce7040e1cfd8aea63f000bf0
parentee8665e28e8d90ce69d4abe5a469c14a8707ae0e (diff)
usb: xhci: fix return value of xhci_setup_device()
xhci_setup_device() should return failure with correct error number when xhci host has died, removed or halted. During usb device enumeration, if usb host is not accessible (died, removed or halted), the hc_driver->address_device() should return a corresponding error code to usb core. But current xhci driver just returns success. This misleads usb core to continue the enumeration by reading the device descriptor, which will result in failure, and users will get a misleading message like "device descriptor read/8, error -110". Cc: <stable@vger.kernel.org> # v4.3+ Signed-off-by: Lu Baolu <baolu.lu@linux.intel.com> Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat