Changeset 2ef036a in mainline for uspace/drv/uhci-hcd/utils/device_keeper.c
- Timestamp:
- 2011-03-14T22:51:09Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 2180979
- Parents:
- 7ffe82f (diff), fcf07e6 (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/utils/device_keeper.c
r7ffe82f r2ef036a 27 27 */ 28 28 29 /** @addtogroup drvusbuhci 29 /** @addtogroup drvusbuhcihc 30 30 * @{ 31 31 */ … … 40 40 41 41 /*----------------------------------------------------------------------------*/ 42 /** Initialize sdevice keeper structure.42 /** Initialize device keeper structure. 43 43 * 44 44 * @param[in] instance Memory place to initialize. 45 * 46 * Set all values to false/0. 45 47 */ 46 48 void device_keeper_init(device_keeper_t *instance) … … 58 60 } 59 61 /*----------------------------------------------------------------------------*/ 60 /** Attempt sto obtain address 0, blocks.62 /** Attempt to obtain address 0, blocks. 61 63 * 62 64 * @param[in] instance Device keeper structure to use. … … 76 78 } 77 79 /*----------------------------------------------------------------------------*/ 78 /** Attempt sto obtain address 0, blocks.80 /** Attempt to obtain address 0, blocks. 79 81 * 80 82 * @param[in] instance Device keeper structure to use. … … 90 92 } 91 93 /*----------------------------------------------------------------------------*/ 92 /** Check s setupdata for signs of toggle reset.94 /** Check setup packet data for signs of toggle reset. 93 95 * 94 96 * @param[in] instance Device keeper structure to use. 95 97 * @param[in] target Device to receive setup packet. 96 98 * @param[in] data Setup packet data. 99 * 100 * Really ugly one. 97 101 */ 98 102 void device_keeper_reset_if_need( … … 105 109 || !instance->devices[target.address].occupied) { 106 110 fibril_mutex_unlock(&instance->guard); 111 usb_log_error("Invalid data when checking for toggle reset.\n"); 107 112 return; 108 113 } … … 130 135 } 131 136 /*----------------------------------------------------------------------------*/ 132 /** Get scurrent value of endpoint toggle.137 /** Get current value of endpoint toggle. 133 138 * 134 139 * @param[in] instance Device keeper structure to use. … … 144 149 || target.address >= USB_ADDRESS_COUNT || target.address < 0 145 150 || !instance->devices[target.address].occupied) { 151 usb_log_error("Invalid data when asking for toggle value.\n"); 146 152 ret = EINVAL; 147 153 } else { 148 ret = 149 (instance->devices[target.address].toggle_status 154 ret = (instance->devices[target.address].toggle_status 150 155 >> target.endpoint) & 1; 151 156 } … … 154 159 } 155 160 /*----------------------------------------------------------------------------*/ 156 /** Set scurrent value of endpoint toggle.161 /** Set current value of endpoint toggle. 157 162 * 158 163 * @param[in] instance Device keeper structure to use. 159 164 * @param[in] target Device and endpoint used. 160 * @param[in] toggle Current toggle value.165 * @param[in] toggle Toggle value. 161 166 * @return Error code. 162 167 */ … … 170 175 || target.address >= USB_ADDRESS_COUNT || target.address < 0 171 176 || !instance->devices[target.address].occupied) { 177 usb_log_error("Invalid data when setting toggle value.\n"); 172 178 ret = EINVAL; 173 179 } else { … … 183 189 } 184 190 /*----------------------------------------------------------------------------*/ 185 /** Get sa free USB address191 /** Get a free USB address 186 192 * 187 193 * @param[in] instance Device keeper structure to use. … … 216 222 } 217 223 /*----------------------------------------------------------------------------*/ 218 /** Bind sUSB address to devman handle.224 /** Bind USB address to devman handle. 219 225 * 220 226 * @param[in] instance Device keeper structure to use. … … 234 240 } 235 241 /*----------------------------------------------------------------------------*/ 236 /** Release sused USB address.242 /** Release used USB address. 237 243 * 238 244 * @param[in] instance Device keeper structure to use. … … 251 257 } 252 258 /*----------------------------------------------------------------------------*/ 253 /** Find sUSB address associated with the device259 /** Find USB address associated with the device 254 260 * 255 261 * @param[in] instance Device keeper structure to use. … … 274 280 } 275 281 /*----------------------------------------------------------------------------*/ 276 /** Get sspeed associated with the address282 /** Get speed associated with the address 277 283 * 278 284 * @param[in] instance Device keeper structure to use.
Note:
See TracChangeset
for help on using the changeset viewer.