Changeset da17cf0 in mainline


Ignore:
Timestamp:
2011-02-07T11:39:52Z (14 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
9a818a9
Parents:
4192d3d6
Message:

Adds tracker support for the old control connection API

Location:
uspace/drv/uhci-hcd
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/uhci-hcd/tracker.c

    r4192d3d6 rda17cf0  
    288288        free(instance);
    289289}
     290/* DEPRECATED FUNCTIONS NEEDED BY THE OLD API */
     291void tracker_control_setup_old(tracker_t *instance)
     292{
     293        assert(instance);
     294        assert(instance->buffer_offset == 0);
     295        instance->packet_size = SETUP_PACKET_DATA_SIZE;
     296        memcpy(instance->packet, instance->buffer, SETUP_PACKET_DATA_SIZE);
     297        transfer_descriptor_init(instance->td, DEFAULT_ERROR_COUNT,
     298            SETUP_PACKET_DATA_SIZE, false, instance->target, USB_PID_SETUP,
     299            instance->packet);
     300        instance->buffer_offset += SETUP_PACKET_DATA_SIZE;
     301        instance->next_step = tracker_call_out_and_dispose;
     302        //TODO: add to scheduler
     303}
     304
     305void tracker_control_write_data_old(tracker_t *instance)
     306{
     307        assert(instance);
     308        assert(instance->max_packet_size == instance->buffer_size);
     309        memcpy(instance->packet, instance->buffer, instance->max_packet_size);
     310        instance->packet_size = instance->max_packet_size;
     311        transfer_descriptor_init(instance->td, DEFAULT_ERROR_COUNT,
     312                        instance->packet_size, false, instance->target, USB_PID_OUT,
     313                        instance->packet);
     314        instance->next_step = tracker_call_out_and_dispose;
     315}
     316
     317void tracker_control_read_data_old(tracker_t *instance)
     318{
     319        assert(instance);
     320        assert(instance->max_packet_size == instance->buffer_size);
     321        instance->packet_size = instance->max_packet_size;
     322        transfer_descriptor_init(instance->td, DEFAULT_ERROR_COUNT,
     323                        instance->packet_size, false, instance->target, USB_PID_IN,
     324                        instance->packet);
     325        instance->next_step = tracker_call_in_and_dispose;
     326}
     327
     328void tracker_control_write_status_old(tracker_t *instance)
     329{
     330        assert(instance);
     331        assert(instance->max_packet_size == 0);
     332        assert(instance->buffer_size == 0);
     333        assert(instance->packet == NULL);
     334
     335        instance->packet_size = instance->max_packet_size;
     336        transfer_descriptor_init(instance->td, DEFAULT_ERROR_COUNT,
     337                        instance->packet_size, false, instance->target, USB_PID_IN,
     338                        instance->packet);
     339        instance->next_step = tracker_call_in_and_dispose;
     340}
     341
     342void tracker_control_read_status_old(tracker_t *instance)
     343{
     344        assert(instance);
     345        assert(instance->max_packet_size == 0);
     346        assert(instance->buffer_size == 0);
     347        assert(instance->packet == NULL);
     348
     349        instance->packet_size = instance->max_packet_size;
     350        transfer_descriptor_init(instance->td, DEFAULT_ERROR_COUNT,
     351                        instance->packet_size, false, instance->target, USB_PID_OUT,
     352                        instance->packet);
     353        instance->next_step = tracker_call_out_and_dispose;
     354}
    290355/**
    291356 * @}
  • uspace/drv/uhci-hcd/tracker.h

    r4192d3d6 rda17cf0  
    9191void tracker_call_out_and_dispose(tracker_t *instance);
    9292
     93/* DEPRECATED FUNCTIONS NEEDED BY THE OLD API */
     94void tracker_control_setup_old(tracker_t *instance);
     95
     96void tracker_control_write_data_old(tracker_t *instance);
     97
     98void tracker_control_read_data_old(tracker_t *instance);
     99
     100void tracker_control_write_status_old(tracker_t *instance);
     101
     102void tracker_control_read_status_old(tracker_t *instance);
    93103#endif
    94104/**
Note: See TracChangeset for help on using the changeset viewer.