Changeset a9c674e0 in mainline


Ignore:
Timestamp:
2011-02-23T15:38:53Z (14 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
233e68d, a80849c
Parents:
eb1a2f4 (diff), d3880aa (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merged small fixes and improvements

Fixed "usbinfo -t uhci" problem.

UHCI root hub prints less messages.

USB MID driver creates exposed "ctl" function (to provide at least
one function when interface drivers are not available).

Location:
uspace
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/usbinfo/main.c

    reb1a2f4 ra9c674e0  
    8282
    8383        if (str_cmp(path, "uhci") == 0) {
    84                 path = "/hw/pci0/00:01.2";
     84                path = "/hw/pci0/00:01.2/uhci";
    8585        }
    8686
  • uspace/drv/uhci-rhd/port.c

    reb1a2f4 ra9c674e0  
    9292
    9393        while (1) {
    94                 usb_log_debug("Port(%d) status address %p:\n",
    95                   port_instance->number, port_instance->address);
    96 
    9794                /* read register value */
    9895                port_status_t port_status =
     
    10097
    10198                /* debug print */
    102                 usb_log_info("Port(%d) status %#.4x\n",
    103                   port_instance->number, port_status);
     99                usb_log_debug("Port %d status at %p: 0x%04x.\n",
     100                  port_instance->number, port_instance->address, port_status);
    104101                print_port_status(port_status);
    105102
  • uspace/drv/usbmid/explore.c

    reb1a2f4 ra9c674e0  
    202202        if (interface_descriptors_count == (size_t) -1) {
    203203                usb_log_error("Problem parsing configuration descriptor.\n");
     204                free(config_descriptor_raw);
     205                free(interface_descriptors);
     206                return false;
     207        }
     208
     209        ddf_fun_t *ctl_fun = ddf_fun_create(dev->dev, fun_exposed, "ctl");
     210        if (ctl_fun == NULL) {
     211                usb_log_error("Failed to create control function.\n");
     212                free(config_descriptor_raw);
     213                free(interface_descriptors);
     214                return false;
     215        }
     216        rc = ddf_fun_bind(ctl_fun);
     217        if (rc != EOK) {
     218                usb_log_error("Failed to bind control function: %s.\n",
     219                    str_error(rc));
    204220                free(config_descriptor_raw);
    205221                free(interface_descriptors);
  • uspace/lib/usb/include/usb/pipes.h

    reb1a2f4 ra9c674e0  
    137137int usb_endpoint_pipe_start_session(usb_endpoint_pipe_t *);
    138138int usb_endpoint_pipe_end_session(usb_endpoint_pipe_t *);
     139bool usb_endpoint_pipe_is_session_started(usb_endpoint_pipe_t *);
    139140
    140141int usb_endpoint_pipe_read(usb_endpoint_pipe_t *, void *, size_t, size_t *);
  • uspace/lib/usb/src/pipes.c

    reb1a2f4 ra9c674e0  
    200200        assert(pipe);
    201201
    202         if (pipe->hc_phone >= 0) {
     202        if (usb_endpoint_pipe_is_session_started(pipe)) {
    203203                return EBUSY;
    204204        }
     
    226226        assert(pipe);
    227227
    228         if (pipe->hc_phone < 0) {
     228        if (!usb_endpoint_pipe_is_session_started(pipe)) {
    229229                return ENOENT;
    230230        }
     
    238238
    239239        return EOK;
     240}
     241
     242/** Tell whether a session is started (open) on the endpoint pipe.
     243 *
     244 * The expected usage of this function is in assertions for some
     245 * nested functions.
     246 *
     247 * @param pipe Endpoint pipe in question.
     248 * @return Whether @p pipe has opened a session.
     249 */
     250bool usb_endpoint_pipe_is_session_started(usb_endpoint_pipe_t *pipe)
     251{
     252        return (pipe->hc_phone >= 0);
    240253}
    241254
  • uspace/lib/usb/src/pipesio.c

    reb1a2f4 ra9c674e0  
    148148        }
    149149
    150         if (pipe->hc_phone < 0) {
     150        if (!usb_endpoint_pipe_is_session_started(pipe)) {
    151151                return EBADF;
    152152        }
     
    255255        }
    256256
    257         if (pipe->hc_phone < 0) {
     257        if (!usb_endpoint_pipe_is_session_started(pipe)) {
    258258                return EBADF;
    259259        }
     
    369369        }
    370370
    371         if (pipe->hc_phone < 0) {
     371        if (!usb_endpoint_pipe_is_session_started(pipe)) {
    372372                return EBADF;
    373373        }
     
    481481        }
    482482
    483         if (pipe->hc_phone < 0) {
     483        if (!usb_endpoint_pipe_is_session_started(pipe)) {
    484484                return EBADF;
    485485        }
Note: See TracChangeset for help on using the changeset viewer.