Changeset 4e38d69 in mainline for uspace/drv/uhci-hcd/iface.c
- Timestamp:
- 2011-02-11T15:05:40Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 5842493
- Parents:
- 1e64b250 (diff), 03197ffc (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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/uhci-hcd/iface.c
r1e64b250 r4e38d69 106 106 usbhc_iface_transfer_out_callback_t callback, void *arg) 107 107 { 108 assert(dev); 109 uhci_t *hc = dev_to_uhci(dev); 110 assert(hc); 111 return uhci_transfer(hc, dev, target, USB_TRANSFER_INTERRUPT, 0, USB_PID_OUT, 112 false, data, size, callback, NULL, arg); 108 size_t max_packet_size = 8; 109 dev_speed_t speed = FULL_SPEED; 110 111 tracker_t *tracker = tracker_get(dev, target, USB_TRANSFER_INTERRUPT, 112 max_packet_size, speed, data, size, NULL, callback, arg); 113 if (!tracker) 114 return ENOMEM; 115 tracker_interrupt_out(tracker); 116 return EOK; 113 117 } 114 118 /*----------------------------------------------------------------------------*/ … … 117 121 usbhc_iface_transfer_in_callback_t callback, void *arg) 118 122 { 119 assert(dev); 120 uhci_t *hc = dev_to_uhci(dev); 121 assert(hc); 122 return uhci_transfer(hc, dev, target, USB_TRANSFER_INTERRUPT, 0, USB_PID_IN, 123 false, data, size, NULL, callback, arg); 123 size_t max_packet_size = 4; 124 dev_speed_t speed = FULL_SPEED; 125 126 tracker_t *tracker = tracker_get(dev, target, USB_TRANSFER_INTERRUPT, 127 max_packet_size, speed, data, size, callback, NULL, arg); 128 if (!tracker) 129 return ENOMEM; 130 tracker_interrupt_in(tracker); 131 return EOK; 132 } 133 /*----------------------------------------------------------------------------*/ 134 static int control_write(device_t *dev, usb_target_t target, 135 void *setup_data, size_t setup_size, void *data, size_t size, 136 usbhc_iface_transfer_out_callback_t callback, void *arg) 137 { 138 size_t max_packet_size = 8; 139 dev_speed_t speed = FULL_SPEED; 140 141 tracker_t *tracker = tracker_get(dev, target, USB_TRANSFER_CONTROL, 142 max_packet_size, speed, data, size, NULL, callback, arg); 143 if (!tracker) 144 return ENOMEM; 145 tracker_control_write(tracker, setup_data, setup_size); 146 return EOK; 147 } 148 /*----------------------------------------------------------------------------*/ 149 static int control_read(device_t *dev, usb_target_t target, 150 void *setup_data, size_t setup_size, void *data, size_t size, 151 usbhc_iface_transfer_in_callback_t callback, void *arg) 152 { 153 size_t max_packet_size = 8; 154 dev_speed_t speed = FULL_SPEED; 155 156 tracker_t *tracker = tracker_get(dev, target, USB_TRANSFER_CONTROL, 157 max_packet_size, speed, data, size, callback, NULL, arg); 158 if (!tracker) 159 return ENOMEM; 160 tracker_control_read(tracker, setup_data, setup_size); 161 return EOK; 124 162 } 125 163 /*----------------------------------------------------------------------------*/ … … 128 166 usbhc_iface_transfer_out_callback_t callback, void *arg) 129 167 { 130 assert(dev); 131 uhci_t *hc = dev_to_uhci(dev); 132 assert(hc); 133 return uhci_transfer(hc, dev, target, USB_TRANSFER_CONTROL, 0, USB_PID_SETUP, 134 false, data, size, callback, NULL, arg); 168 usb_log_warning("Using deprecated API control write setup.\n"); 169 tracker_t *tracker = tracker_get(dev, target, USB_TRANSFER_CONTROL, 170 8, FULL_SPEED, data, size, NULL, callback, arg); 171 if (!tracker) 172 return ENOMEM; 173 tracker_control_setup_old(tracker); 174 return EOK; 135 175 } 136 176 /*----------------------------------------------------------------------------*/ … … 139 179 usbhc_iface_transfer_out_callback_t callback, void *arg) 140 180 { 141 assert(dev); 142 uhci_t *hc = dev_to_uhci(dev); 143 assert(hc); 144 return uhci_transfer(hc, dev, target, USB_TRANSFER_CONTROL, 1, USB_PID_OUT, 145 false, data, size, callback, NULL, arg); 181 tracker_t *tracker = tracker_get(dev, target, USB_TRANSFER_CONTROL, 182 size, FULL_SPEED, data, size, NULL, callback, arg); 183 if (!tracker) 184 return ENOMEM; 185 tracker_control_write_data_old(tracker); 186 return EOK; 146 187 } 147 188 /*----------------------------------------------------------------------------*/ … … 149 190 usbhc_iface_transfer_in_callback_t callback, void *arg) 150 191 { 151 assert(dev); 152 uhci_t *hc = dev_to_uhci(dev); 153 assert(hc); 154 return uhci_transfer(hc, dev, target, USB_TRANSFER_CONTROL, 0, USB_PID_IN, 155 false, NULL, 0, NULL, callback, arg); 192 tracker_t *tracker = tracker_get(dev, target, USB_TRANSFER_CONTROL, 193 0, FULL_SPEED, NULL, 0, callback, NULL, arg); 194 if (!tracker) 195 return ENOMEM; 196 tracker_control_write_status_old(tracker); 197 return EOK; 156 198 } 157 199 /*----------------------------------------------------------------------------*/ … … 160 202 usbhc_iface_transfer_out_callback_t callback, void *arg) 161 203 { 162 assert(dev); 163 uhci_t *hc = dev_to_uhci(dev); 164 assert(hc); 165 return uhci_transfer(hc, dev, target, USB_TRANSFER_CONTROL, 0, USB_PID_SETUP, 166 false, data, size, callback, NULL, arg); 204 usb_log_warning("Using deprecated API control read setup.\n"); 205 tracker_t *tracker = tracker_get(dev, target, USB_TRANSFER_CONTROL, 206 8, FULL_SPEED, data, size, NULL, callback, arg); 207 if (!tracker) 208 return ENOMEM; 209 tracker_control_setup_old(tracker); 210 return EOK; 167 211 } 168 212 /*----------------------------------------------------------------------------*/ … … 171 215 usbhc_iface_transfer_in_callback_t callback, void *arg) 172 216 { 173 assert(dev); 174 uhci_t *hc = dev_to_uhci(dev); 175 assert(hc); 176 return uhci_transfer(hc, dev, target, USB_TRANSFER_CONTROL, 1, USB_PID_IN, 177 false, data, size, NULL, callback, arg); 217 tracker_t *tracker = tracker_get(dev, target, USB_TRANSFER_CONTROL, 218 size, FULL_SPEED, data, size, callback, NULL, arg); 219 if (!tracker) 220 return ENOMEM; 221 tracker_control_read_data_old(tracker); 222 return EOK; 178 223 } 179 224 /*----------------------------------------------------------------------------*/ … … 181 226 usbhc_iface_transfer_out_callback_t callback, void *arg) 182 227 { 183 assert(dev);184 uhci_t *hc = dev_to_uhci(dev);185 assert(hc);186 return uhci_transfer(hc, dev, target, USB_TRANSFER_CONTROL, 0, USB_PID_OUT,187 false, NULL, 0, callback, NULL, arg);188 } 189 190 228 tracker_t *tracker = tracker_get(dev, target, USB_TRANSFER_CONTROL, 229 0, FULL_SPEED, NULL, 0, NULL, callback, arg); 230 if (!tracker) 231 return ENOMEM; 232 tracker_control_read_status_old(tracker); 233 return EOK; 234 } 235 /*----------------------------------------------------------------------------*/ 191 236 usbhc_iface_t uhci_iface = { 192 237 .tell_address = get_address, … … 200 245 .interrupt_out = interrupt_out, 201 246 .interrupt_in = interrupt_in, 247 248 .control_read = control_read, 249 .control_write = control_write, 202 250 203 251 .control_write_setup = control_write_setup,
Note:
See TracChangeset
for help on using the changeset viewer.