Changes in uspace/drv/nic/ar9271/htc.c [8a64320e:b7fd2a0] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/nic/ar9271/htc.c
r8a64320e rb7fd2a0 36 36 #include <byteorder.h> 37 37 #include <errno.h> 38 #include <str_error.h> 38 39 #include "wmi.h" 39 40 #include "htc.h" … … 65 66 } 66 67 67 int htc_init_new_vif(htc_device_t *htc_device)68 errno_t htc_init_new_vif(htc_device_t *htc_device) 68 69 { 69 70 htc_vif_msg_t vif_msg; … … 149 150 * @param endpoint_id Destination endpoint. 150 151 * 151 * @return EOK if succeed, negativeerror code otherwise.152 * 153 */ 154 int htc_send_control_message(htc_device_t *htc_device, void *buffer,152 * @return EOK if succeed, error code otherwise. 153 * 154 */ 155 errno_t htc_send_control_message(htc_device_t *htc_device, void *buffer, 155 156 size_t buffer_size, uint8_t endpoint_id) 156 157 { … … 172 173 * @param endpoint_id Destination endpoint. 173 174 * 174 * @return EOK if succeed, negativeerror code otherwise.175 * 176 */ 177 int htc_send_data_message(htc_device_t *htc_device, void *buffer,175 * @return EOK if succeed, error code otherwise. 176 * 177 */ 178 errno_t htc_send_data_message(htc_device_t *htc_device, void *buffer, 178 179 size_t buffer_size, uint8_t endpoint_id) 179 180 { … … 195 196 * @param transferred_size Real size of read data. 196 197 * 197 * @return EOK if succeed, negativeerror code otherwise.198 * 199 */ 200 int htc_read_data_message(htc_device_t *htc_device, void *buffer,198 * @return EOK if succeed, error code otherwise. 199 * 200 */ 201 errno_t htc_read_data_message(htc_device_t *htc_device, void *buffer, 201 202 size_t buffer_size, size_t *transferred_size) 202 203 { … … 215 216 * @param transferred_size Real size of read data. 216 217 * 217 * @return EOK if succeed, negativeerror code otherwise.218 * 219 */ 220 int htc_read_control_message(htc_device_t *htc_device, void *buffer,218 * @return EOK if succeed, error code otherwise. 219 * 220 */ 221 errno_t htc_read_control_message(htc_device_t *htc_device, void *buffer, 221 222 size_t buffer_size, size_t *transferred_size) 222 223 { … … 235 236 * 236 237 * @return EOK if succeed, EINVAL when failed to connect service, 237 * negativeerror code otherwise.238 * 239 */ 240 static int htc_connect_service(htc_device_t *htc_device,238 * error code otherwise. 239 * 240 */ 241 static errno_t htc_connect_service(htc_device_t *htc_device, 241 242 wmi_services_t service_id, int *response_endpoint_no) 242 243 { … … 260 261 261 262 /* Send HTC message. */ 262 int rc = htc_send_control_message(htc_device, buffer, buffer_size,263 errno_t rc = htc_send_control_message(htc_device, buffer, buffer_size, 263 264 htc_device->endpoints.ctrl_endpoint); 264 265 if (rc != EOK) { 265 266 free(buffer); 266 usb_log_error("Failed to send HTC message. Error: % d\n", rc);267 usb_log_error("Failed to send HTC message. Error: %s\n", str_error_name(rc)); 267 268 return rc; 268 269 } … … 278 279 free(buffer); 279 280 usb_log_error("Failed to receive HTC service connect response. " 280 "Error: % d\n", rc);281 "Error: %s\n", str_error_name(rc)); 281 282 return rc; 282 283 } … … 308 309 * @param htc_device HTC device structure. 309 310 * 310 * @return EOK if succeed, negativeerror code otherwise.311 * 312 */ 313 static int htc_config_credits(htc_device_t *htc_device)311 * @return EOK if succeed, error code otherwise. 312 * 313 */ 314 static errno_t htc_config_credits(htc_device_t *htc_device) 314 315 { 315 316 size_t buffer_size = sizeof(htc_frame_header_t) + … … 326 327 327 328 /* Send HTC message. */ 328 int rc = htc_send_control_message(htc_device, buffer, buffer_size,329 errno_t rc = htc_send_control_message(htc_device, buffer, buffer_size, 329 330 htc_device->endpoints.ctrl_endpoint); 330 331 if (rc != EOK) { 331 332 free(buffer); 332 333 usb_log_error("Failed to send HTC config message. " 333 "Error: % d\n", rc);334 "Error: %s\n", str_error_name(rc)); 334 335 return rc; 335 336 } … … 344 345 if (rc != EOK) { 345 346 usb_log_error("Failed to receive HTC config response message. " 346 "Error: % d\n", rc);347 "Error: %s\n", str_error_name(rc)); 347 348 } 348 349 … … 356 357 * @param htc_device HTC device structure. 357 358 * 358 * @return EOK if succeed, negativeerror code otherwise.359 * 360 */ 361 static int htc_complete_setup(htc_device_t *htc_device)359 * @return EOK if succeed, error code otherwise. 360 * 361 */ 362 static errno_t htc_complete_setup(htc_device_t *htc_device) 362 363 { 363 364 size_t buffer_size = sizeof(htc_frame_header_t) + … … 372 373 373 374 /* Send HTC message. */ 374 int rc = htc_send_control_message(htc_device, buffer, buffer_size,375 errno_t rc = htc_send_control_message(htc_device, buffer, buffer_size, 375 376 htc_device->endpoints.ctrl_endpoint); 376 377 if (rc != EOK) 377 378 usb_log_error("Failed to send HTC setup complete message. " 378 "Error: % d\n", rc);379 "Error: %s\n", str_error_name(rc)); 379 380 380 381 free(buffer); … … 390 391 * 391 392 * @return EOK if succeed, EINVAL if response error, 392 * negativeerror code otherwise.393 * 394 */ 395 static int htc_check_ready(htc_device_t *htc_device)393 * error code otherwise. 394 * 395 */ 396 static errno_t htc_check_ready(htc_device_t *htc_device) 396 397 { 397 398 size_t buffer_size = htc_device->ath_device->ctrl_response_length; … … 399 400 400 401 /* Read response from device. */ 401 int rc = htc_read_control_message(htc_device, buffer, buffer_size,402 errno_t rc = htc_read_control_message(htc_device, buffer, buffer_size, 402 403 NULL); 403 404 if (rc != EOK) { 404 405 free(buffer); 405 406 usb_log_error("Failed to receive HTC check ready message. " 406 "Error: % d\n", rc);407 "Error: %s\n", str_error_name(rc)); 407 408 return rc; 408 409 } … … 426 427 * @param htc_device HTC device structure to be initialized. 427 428 * 428 * @return EOK if succeed, negativeerror code otherwise.429 * 430 */ 431 int htc_device_init(ath_t *ath_device, ieee80211_dev_t *ieee80211_dev,429 * @return EOK if succeed, error code otherwise. 430 * 431 */ 432 errno_t htc_device_init(ath_t *ath_device, ieee80211_dev_t *ieee80211_dev, 432 433 htc_device_t *htc_device) 433 434 { … … 447 448 * @param htc_device HTC device structure. 448 449 * 449 * @return EOK if succeed, negativeerror code otherwise.450 * 451 */ 452 int htc_init(htc_device_t *htc_device)450 * @return EOK if succeed, error code otherwise. 451 * 452 */ 453 errno_t htc_init(htc_device_t *htc_device) 453 454 { 454 455 /* First check ready message in device. */ 455 int rc = htc_check_ready(htc_device);456 errno_t rc = htc_check_ready(htc_device); 456 457 if (rc != EOK) { 457 458 usb_log_error("Device is not in ready state after loading "
Note:
See TracChangeset
for help on using the changeset viewer.