source: mainline/uspace/drv/uhci-rhd/port_status.c@ 1256a0a

lfn serial ticket/834-toolchain-update topic/msim-upgrade topic/simplify-dev-export
Last change on this file since 1256a0a was 1256a0a, checked in by Jan Vesely <jano.vesely@…>, 14 years ago

uhci-rhd - UHCI Root hub drier as a separated process

this wil deffinitely need a lot of polishing

  • Property mode set to 100644
File size: 849 bytes
RevLine 
[3515533]1#include <assert.h>
2#include <stdio.h>
3
[8f748215]4#include "debug.h"
[3515533]5#include "port_status.h"
6
[8f748215]7struct flag_name
[3515533]8{
[8f748215]9 unsigned flag;
10 const char *name;
11};
12
13static const struct flag_name flags[] =
14{
15 { STATUS_SUSPEND, "suspended" },
16 { STATUS_IN_RESET, "in reset" },
17 { STATUS_LOW_SPEED, "low speed device" },
18 { STATUS_ALWAYS_ONE, "always 1 bit" },
19 { STATUS_RESUME, "resume" },
20 { STATUS_LINE_D_MINUS, "line D- value" },
21 { STATUS_LINE_D_PLUS, "line D+ value" },
22 { STATUS_ENABLED_CHANGED, "enabled changed" },
23 { STATUS_ENABLED, "enabled" },
24 { STATUS_CONNECTED_CHANGED, "connected changed" },
25 { STATUS_CONNECTED, "connected" }
26};
27
28void print_port_status(port_status_t value)
29{
30 unsigned i = 0;
31 for (;i < sizeof(flags)/sizeof(struct flag_name); ++i) {
32 uhci_print_verbose("\t%s status: %s.\n", flags[i].name,
[602eac5]33 value & flags[i].flag ? "YES" : "NO");
[8f748215]34 }
[3515533]35}
Note: See TracBrowser for help on using the repository browser.